3v4l.org

run code in 300+ PHP versions simultaneously
<?php $previous = NULL; function call() { var_dump( __FUNCTION__ ); } set_error_handler( 'call' ); trigger_error( 'some message 1', E_USER_NOTICE ); $previous = set_error_handler( function() use( $previous ) { // note that previous is null, because of association sequence var_dump( __FUNCTION__ ); } ); trigger_error( 'some message 2', E_USER_NOTICE ); var_dump( set_error_handler( NULL ) ); trigger_error( 'some message 3', E_USER_NOTICE );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vmGgL
function name:  (null)
number of ops:  29
compiled vars:  !0 = $previous
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, null
    6     1        INIT_FCALL                                               'set_error_handler'
          2        SEND_VAL                                                 'call'
          3        DO_ICALL                                                 
    7     4        INIT_FCALL                                               'trigger_error'
          5        SEND_VAL                                                 'some+message+1'
          6        SEND_VAL                                                 1024
          7        DO_ICALL                                                 
    8     8        INIT_FCALL                                               'set_error_handler'
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FvmGgL%3A8%240'
         10        BIND_LEXICAL                                             ~4, !0
   11    11        SEND_VAL                                                 ~4
         12        DO_ICALL                                         $5      
    8    13        ASSIGN                                                   !0, $5
   12    14        INIT_FCALL                                               'trigger_error'
         15        SEND_VAL                                                 'some+message+2'
         16        SEND_VAL                                                 1024
         17        DO_ICALL                                                 
   13    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'set_error_handler'
         20        SEND_VAL                                                 null
         21        DO_ICALL                                         $8      
         22        SEND_VAR                                                 $8
         23        DO_ICALL                                                 
   14    24        INIT_FCALL                                               'trigger_error'
         25        SEND_VAL                                                 'some+message+3'
         26        SEND_VAL                                                 1024
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Function call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vmGgL
function name:  call
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'call'
          2        DO_ICALL                                                 
    5     3      > RETURN                                                   null

End of function call

Function %00%7Bclosure%7D%2Fin%2FvmGgL%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vmGgL
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $previous
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   BIND_STATIC                                              !0
   10     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAL                                                 '%7Bclosure%7D'
          3        DO_ICALL                                                 
   11     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FvmGgL%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.8 ms | 1400 KiB | 19 Q