3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar( $input ) { static $var = null; if ( null === $var ) { $input = $var; } return $var; } } $o1 = new Foo(); echo $o1->bar( "Hello, " ); $o2 = new Foo(); echo $o2->bar( "World!" );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/riloG
function name:  (null)
number of ops:  15
compiled vars:  !0 = $o1, !1 = $o2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   16     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        SEND_VAL_EX                                              'Hello%2C+'
          5        DO_FCALL                                      0  $5      
          6        ECHO                                                     $5
   17     7        NEW                                              $6      'Foo'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $6
   18    10        INIT_METHOD_CALL                                         !1, 'bar'
         11        SEND_VAL_EX                                              'World%21'
         12        DO_FCALL                                      0  $9      
         13        ECHO                                                     $9
         14      > RETURN                                                   1

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

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.55 ms | 1394 KiB | 13 Q