3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Legacy { private $_ignore; /** * @param int $ignore */ public function __construct($ignore = E_STRICT) { $this->_ignore = $ignore; } /** * @param callable $func * @return mixed * @throws \Exception */ public function call(callable $func) { $args = func_get_args(); array_shift($args); $er = error_reporting(); error_reporting($er &~ $this->_ignore); try { $ret = call_user_func_array($func, $args); error_reporting($er); return $ret; } catch (\Exception $ex) { error_reporting($er); throw $ex; } } } var_dump(error_reporting()); (new Legacy())->call(function(){ // strict warningが発生する処理 var_dump(error_reporting()); }); var_dump(error_reporting());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VFESB
function name:  (null)
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'error_reporting'
          2        DO_ICALL                                         $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
   42     5        NEW                                              $2      'Legacy'
          6        DO_FCALL                                      0          
          7        INIT_METHOD_CALL                                         $2, 'call'
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FVFESB%3A42%240'
   45     9        SEND_VAL_EX                                              ~4
         10        DO_FCALL                                      0          
   46    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'error_reporting'
         13        DO_ICALL                                         $6      
         14        SEND_VAR                                                 $6
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FVFESB%3A42%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VFESB
function name:  {closure}
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'error_reporting'
          2        DO_ICALL                                         $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
   45     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FVFESB%3A42%240

Class Legacy:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VFESB
function name:  __construct
number of ops:  4
compiled vars:  !0 = $ignore
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV_INIT                                        !0      <const ast>
   11     1        ASSIGN_OBJ                                               '_ignore'
          2        OP_DATA                                                  !0
   12     3      > RETURN                                                   null

End of function __construct

Function call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 25
Branch analysis from position: 25
2 jumps found. (Code = 107) Position 1 = 26, Position 2 = -2
Branch analysis from position: 26
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/VFESB
function name:  call
number of ops:  31
compiled vars:  !0 = $func, !1 = $args, !2 = $er, !3 = $ret, !4 = $ex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1        FUNC_GET_ARGS                                    ~5      
          2        ASSIGN                                                   !1, ~5
   22     3        INIT_FCALL                                               'array_shift'
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
   24     6        INIT_FCALL                                               'error_reporting'
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !2, $8
   25     9        INIT_FCALL                                               'error_reporting'
         10        FETCH_OBJ_R                                      ~10     '_ignore'
         11        BW_NOT                                           ~11     ~10
         12        BW_AND                                           ~12     !2, ~11
         13        SEND_VAL                                                 ~12
         14        DO_ICALL                                                 
   29    15        INIT_USER_CALL                                0          'call_user_func_array', !0
         16        SEND_ARRAY                                               !1
         17        CHECK_UNDEF_ARGS                                         
         18        DO_FCALL                                      0  $14     
         19        ASSIGN                                                   !3, $14
   30    20        INIT_FCALL                                               'error_reporting'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
   31    23      > RETURN                                                   !3
         24*       JMP                                                      ->30
   33    25  E > > CATCH                                       last         'Exception'
   35    26    >   INIT_FCALL                                               'error_reporting'
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                                 
   36    29      > THROW                                         0          !4
   38    30*     > RETURN                                                   null

End of function call

End of class Legacy.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.82 ms | 1400 KiB | 19 Q