3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function __construct(private string $value) {} public function __destruct() { var_dump($this->value); } } function test() { $a = new Foo('a'); $b = new Foo('b'); $c = new Foo('c'); print "Destructor order:\n"; } test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iGAPj
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                                   'test'
          1        DO_FCALL                                          0          
          2      > RETURN                                                       1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iGAPj
function name:  test
number of ops:  14
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   NEW                                                  $3      'Foo'
          1        SEND_VAL_EX                                                  'a'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $3
   12     4        NEW                                                  $6      'Foo'
          5        SEND_VAL_EX                                                  'b'
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $6
   13     8        NEW                                                  $9      'Foo'
          9        SEND_VAL_EX                                                  'c'
         10        DO_FCALL                                          0          
         11        ASSIGN                                                       !2, $9
   14    12        ECHO                                                         'Destructor+order%3A%0A'
   15    13      > RETURN                                                       null

End of function test

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iGAPj
function name:  __construct
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        ASSIGN_OBJ                                                   'value'
          2        OP_DATA                                                      !0
          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/iGAPj
function name:  __destruct
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                                   'var_dump'
          1        FETCH_OBJ_R                                          ~0      'value'
          2        SEND_VAL                                                     ~0
          3        DO_ICALL                                                     
    7     4      > RETURN                                                       null

End of function __destruct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.11 ms | 1869 KiB | 15 Q