3v4l.org

run code in 300+ PHP versions simultaneously
<?php function my_errorhandler($errno,$errormsg) { global $my_var; $my_var = 0; echo "EROOR: $errormsg\n"; return null; } function asdf($a, $b) { var_dump("called"); } set_error_handler("my_errorhandler"); $my_var = asdf("A",$my_var[0]->errormsg = "xyz"); echo "ok\n"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZQnmG
function name:  (null)
number of ops:  13
compiled vars:  !0 = $my_var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'my_errorhandler'
          2        DO_ICALL                                                 
   14     3        INIT_FCALL                                               'asdf'
          4        SEND_VAL                                                 'A'
          5        FETCH_DIM_W                                      $2      !0, 0
          6        ASSIGN_OBJ                                       ~3      $2, 'errormsg'
          7        OP_DATA                                                  'xyz'
          8        SEND_VAL                                                 ~3
          9        DO_FCALL                                      0  $4      
         10        ASSIGN                                                   !0, $4
   15    11        ECHO                                                     'ok%0A'
   16    12      > RETURN                                                   1

Function my_errorhandler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZQnmG
function name:  my_errorhandler
number of ops:  10
compiled vars:  !0 = $errno, !1 = $errormsg, !2 = $my_var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        BIND_GLOBAL                                              !2, 'my_var'
    4     3        ASSIGN                                                   !2, 0
    5     4        ROPE_INIT                                     3  ~5      'EROOR%3A+'
          5        ROPE_ADD                                      1  ~5      ~5, !1
          6        ROPE_END                                      2  ~4      ~5, '%0A'
          7        ECHO                                                     ~4
    6     8      > RETURN                                                   null
    7     9*     > RETURN                                                   null

End of function my_errorhandler

Function asdf:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZQnmG
function name:  asdf
number of ops:  6
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAL                                                 'called'
          4        DO_ICALL                                                 
   11     5      > RETURN                                                   null

End of function asdf

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.95 ms | 1398 KiB | 18 Q