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; } set_error_handler("my_errorhandler"); $my_var = str_repeat("A",$my_var[0]->errormsg = "xyz"); var_dump($my_var); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kd09H
function name:  (null)
number of ops:  15
compiled vars:  !0 = $my_var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'my_errorhandler'
          2        DO_ICALL                                                 
    9     3        INIT_FCALL                                               'str_repeat'
          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_ICALL                                         $4      
         10        ASSIGN                                                   !0, $4
   10    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
   11    14      > RETURN                                                   1

Function my_errorhandler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kd09H
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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.87 ms | 1395 KiB | 19 Q