3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public static $person; public function sayHello() { Foo::$person += 1; echo 'Hello'; } public function getNumber(){ return Foo::$person; } } $foo1 = new Foo(); $foo1->sayHello(); $foo2 = new Foo(); $foo2->sayHello(); $foo1->getNumber(); $foo2->getNumber();
based on 0BJr2
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/e7gfi
function name:  (null)
number of ops:  16
compiled vars:  !0 = $foo1, !1 = $foo2
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  24     1        NEW                                              $3      :-6
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $3
  26     4        INIT_METHOD_CALL                                         !0, 'sayHello'
         5        DO_FCALL                                      0          
  29     6        NEW                                              $7      :-2
         7        DO_FCALL                                      0          
         8        ASSIGN                                                   !1, $7
  31     9        INIT_METHOD_CALL                                         !1, 'sayHello'
        10        DO_FCALL                                      0          
  33    11        INIT_METHOD_CALL                                         !0, 'getNumber'
        12        DO_FCALL                                      0          
  35    13        INIT_METHOD_CALL                                         !1, 'getNumber'
        14        DO_FCALL                                      0          
        15      > RETURN                                                   1

Class Foo:
Function sayhello:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/e7gfi
function name:  sayHello
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  10     0  E >   FETCH_RW                     static member       $0      'person'
         1        ASSIGN_ADD                                    0          $0, 1
  11     2        ECHO                                                     'Hello'
  12     3      > RETURN                                                   null

End of function sayhello

Function getnumber:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/e7gfi
function name:  getNumber
number of ops:  3
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  17     0  E >   FETCH_R                      static member       $0      'person'
         1      > RETURN                                                   $0
  18     2*     > RETURN                                                   null

End of function getnumber

End of class Foo.

Generated using Vulcan Logic Dumper, using php 7.2.0