3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __construct() { var_dump('created!'); } } class Bar { public function getFoo() { static $foo; return $foo ?? ($foo = new Foo); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1nYM2
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E > > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1nYM2
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 'created%21'
          2        DO_ICALL                                                 
    8     3      > RETURN                                                   null

End of function __construct

End of class Foo.

Class Bar:
Function getfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1nYM2
function name:  getFoo
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   BIND_STATIC                                              !0
   17     1        COALESCE                                         ~1      !0
          2        NEW                                              $2      'Foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                           ~4      !0, $2
          5        QM_ASSIGN                                        ~1      ~4
          6      > RETURN                                                   ~1
   18     7*     > RETURN                                                   null

End of function getfoo

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.16 ms | 1395 KiB | 15 Q