3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test_data1 = array('one','two','three'); // all is ok $test_data2 = array(array('one','two','three')); // windows error: // #The instruction at '<address>' referenced memory at '<address>'. // #The memory could not be read. // #Click OK to terminate the program. // No error shows up in console, sometimes script stops without error but sometimes executes like nothing is happening. $test_data3 = array(array('one','two','three'),array('four','five','six')); // error in PHP console: // Fatal error: Call to a member function show_message() on a non-object in c:\scripts\found-error.php on line xx // values one two three are displayed, four five and six are ommitted. class myClass { function iterate_multidim_array($array) { array_walk_recursive($array,function(&$val,$key,&$obj) { $obj->show_message($val); },$this); } function show_message($msg) { echo $msg."\n"; } } $myInstance = new MyClass(); $myInstance-> iterate_multidim_array($test_data3); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B8FU9
function name:  (null)
number of ops:  10
compiled vars:  !0 = $test_data1, !1 = $test_data2, !2 = $test_data3, !3 = $myInstance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
   12     2        ASSIGN                                                   !2, <array>
   31     3        NEW                                              $7      'MyClass'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !3, $7
   32     6        INIT_METHOD_CALL                                         !3, 'iterate_multidim_array'
          7        SEND_VAR_EX                                              !2
          8        DO_FCALL                                      0          
   33     9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FB8FU9%3A20%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B8FU9
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $val, !1 = $key, !2 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   21     3        INIT_METHOD_CALL                                         !2, 'show_message'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
   22     6      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FB8FU9%3A20%240

Class myClass:
Function iterate_multidim_array:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B8FU9
function name:  iterate_multidim_array
number of ops:  9
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        INIT_FCALL                                               'array_walk_recursive'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FB8FU9%3A20%240'
   22     4        SEND_VAL                                                 ~1
          5        FETCH_THIS                                       ~2      
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   23     8      > RETURN                                                   null

End of function iterate_multidim_array

Function show_message:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B8FU9
function name:  show_message
number of ops:  4
compiled vars:  !0 = $msg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   26     1        CONCAT                                           ~1      !0, '%0A'
          2        ECHO                                                     ~1
   27     3      > RETURN                                                   null

End of function show_message

End of class myClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.72 ms | 1400 KiB | 15 Q