3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { public $num = 0; public static $nums = 1; public function __construct() { $this->num = self::$nums++; echo "Building {$this->num}\n"; } public function __destruct() { echo "Tearing down {$this->num}\n"; } } function foo() { echo "In Foo\n"; $bar = new Bar; echo "Leaving Foo\n"; } echo "Starting\n"; foo(); echo "Ending\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/96rlc
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ECHO                                                     'Starting%0A'
   22     1        INIT_FCALL                                               'foo'
          2        DO_FCALL                                      0          
   23     3        ECHO                                                     'Ending%0A'
          4      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/96rlc
function name:  foo
number of ops:  6
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'In+Foo%0A'
   17     1        NEW                                              $1      'Bar'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   18     4        ECHO                                                     'Leaving+Foo%0A'
   19     5      > RETURN                                                   null

End of function foo

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/96rlc
function name:  __construct
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   POST_INC_STATIC_PROP                             ~1      'nums'
          1        ASSIGN_OBJ                                               'num'
          2        OP_DATA                                                  ~1
    8     3        ROPE_INIT                                     3  ~4      'Building+'
          4        FETCH_OBJ_R                                      ~2      'num'
          5        ROPE_ADD                                      1  ~4      ~4, ~2
          6        ROPE_END                                      2  ~3      ~4, '%0A'
          7        ECHO                                                     ~3
    9     8      > 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/96rlc
function name:  __destruct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ROPE_INIT                                     3  ~2      'Tearing+down+'
          1        FETCH_OBJ_R                                      ~0      'num'
          2        ROPE_ADD                                      1  ~2      ~2, ~0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
   12     5      > RETURN                                                   null

End of function __destruct

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.03 ms | 1399 KiB | 14 Q