3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar; public function foo() { static $foo = NULL; if ($foo === NULL) { $foo = $this->bar; } return $foo; } } $f1 = new Foo(); $f1->bar = '1'; echo $f1->foo(); $f2 = new Foo(); $f2->bar = '2'; echo $f2->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8hug6
function name:  (null)
number of ops:  17
compiled vars:  !0 = $f1, !1 = $f2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   19     3        ASSIGN_OBJ                                               !0, 'bar'
          4        OP_DATA                                                  '1'
   20     5        INIT_METHOD_CALL                                         !0, 'foo'
          6        DO_FCALL                                      0  $6      
          7        ECHO                                                     $6
   22     8        NEW                                              $7      'Foo'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $7
   23    11        ASSIGN_OBJ                                               !1, 'bar'
         12        OP_DATA                                                  '2'
   24    13        INIT_METHOD_CALL                                         !1, 'foo'
         14        DO_FCALL                                      0  $11     
         15        ECHO                                                     $11
         16      > RETURN                                                   1

Class Foo:
Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/8hug6
function name:  foo
number of ops:  7
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    9     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->5
   11     3    >   FETCH_OBJ_R                                      ~2      'bar'
          4        ASSIGN                                                   !0, ~2
   14     5    > > RETURN                                                   !0
   15     6*     > RETURN                                                   null

End of function foo

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.27 ms | 1394 KiB | 13 Q