3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function __construct() { register_shutdown_function(function() { echo "Destructing\n"; }); } } echo "1\n"; $var = new Test; unset($var); echo "2\n"; $var = new Test; throw new Exception('Oh dear!');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/PJimX
function name:  (null)
number of ops:  14
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     '1%0A'
   12     1        NEW                                              $1      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   13     4        UNSET_CV                                                 !0
   15     5        ECHO                                                     '2%0A'
   16     6        NEW                                              $4      'Test'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !0, $4
   17     9        NEW                                              $7      'Exception'
         10        SEND_VAL_EX                                              'Oh+dear%21'
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $7
         13*     > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FPJimX%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PJimX
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     'Destructing%0A'
    7     1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FPJimX%3A5%240

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PJimX
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'register_shutdown_function'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FPJimX%3A5%240'
    7     2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    8     4      > RETURN                                                   null

End of function __construct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.55 ms | 1395 KiB | 15 Q