3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo{ private $that; function __construct(){ $this->that = $this; } function __destruct(){ echo "destruct\n"; } } (function(){ $x = new Foo(); })(); echo "wat";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NbufW
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FNbufW%3A13%240'
   15     1        INIT_DYNAMIC_CALL                                        ~0
          2        DO_FCALL                                      0          
   17     3        ECHO                                                     'wat'
          4      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FNbufW%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NbufW
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FNbufW%3A13%240

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NbufW
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_THIS                                       ~1      
          1        ASSIGN_OBJ                                               'that'
          2        OP_DATA                                                  ~1
    7     3      > RETURN                                                   null

End of function __construct

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NbufW
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'destruct%0A'
   10     1      > RETURN                                                   null

End of function __destruct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.82 ms | 1405 KiB | 13 Q