Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2012
    Posts
    481
    Plugin Contributions
    0

    Default deprecated function zen_string_to_int

    I've encountered the following warning in the admin:
    Call to deprecated function zen_string_to_int. Use a closure instead.
    The function is a callback function in array_map. Can someone please explain what a closure is and how to use it to avoid the warning?

    The entire log message (edited for security) follows:
    [23-Apr-2025 10:19:59 America/New_York] Request URI: /admin/index.php?cmd=products_with_attributes_stock&products_id=800&quantity=0&customid =myID&skuTitle=myTitle&attributes=,,,,,,164209,,,,,,,,,,,&add_edit=add&action=ex ecute, IP address: ::1, Language id 1
    #0 [internal function]: zen_debug_error_handler()
    #1 /myDomain/includes/functions/functions_strings.php(406): trigger_error()
    #2 [internal function]: zen_string_to_int()
    #3 /myDomain/admin/products_with_attributes_stock.php(620): array_map()
    #4 /myDomain/admin/index.php(11): require('/...')
    --> PHP Deprecated: Call to deprecated function zen_string_to_int. Use a closure instead in /myDomain/includes/functions/functions_strings.php on line 406.
    Thank you.
    Dave

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,937
    Plugin Contributions
    96

    Default Re: deprecated function zen_string_to_int

    You can correct the issue by replacing any usage of zen_string_to_int($var) with a simple (int)$var.

    Note that this post should be submitted to the support-thread for stock-by-attributes.

 

 

Similar Threads

  1. Replies: 9
    Last Post: 16 Feb 2024, 06:20 PM
  2. v137 Deprecated: Function ereg() is deprecated Error
    By esugrue in forum General Questions
    Replies: 6
    Last Post: 28 Mar 2012, 11:40 PM
  3. Deprecated: Function ereg() is deprecated
    By hsartcorp in forum General Questions
    Replies: 3
    Last Post: 19 Sep 2011, 08:08 PM
  4. Replies: 2
    Last Post: 3 Mar 2010, 12:53 PM
  5. Replies: 4
    Last Post: 16 Jan 2010, 02:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg