3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function deprecatedVersion() { return static::newVersion(); } public function newVersion() { return 'foo'; } } $foo = new Foo(); var_dump($foo->deprecatedVersion()); var_dump($foo->newVersion()); var_dump($foo::deprecatedVersion()); var_dump($foo::newVersion()); var_dump(Foo::deprecatedVersion()); var_dump(Foo::newVersion());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MPjfN
function name:  (null)
number of ops:  36
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'deprecatedVersion'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
   17     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !0, 'newVersion'
         10        DO_FCALL                                      0  $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                                 
   18    13        INIT_FCALL                                               'var_dump'
         14        FETCH_CLASS                                   0  $8      !0
         15        INIT_STATIC_METHOD_CALL                                  $8, 'deprecatedVersion'
         16        DO_FCALL                                      0  $9      
         17        SEND_VAR                                                 $9
         18        DO_ICALL                                                 
   19    19        INIT_FCALL                                               'var_dump'
         20        FETCH_CLASS                                   0  $11     !0
         21        INIT_STATIC_METHOD_CALL                                  $11, 'newVersion'
         22        DO_FCALL                                      0  $12     
         23        SEND_VAR                                                 $12
         24        DO_ICALL                                                 
   20    25        INIT_FCALL                                               'var_dump'
         26        INIT_STATIC_METHOD_CALL                                  'Foo', 'deprecatedVersion'
         27        DO_FCALL                                      0  $14     
         28        SEND_VAR                                                 $14
         29        DO_ICALL                                                 
   21    30        INIT_FCALL                                               'var_dump'
         31        INIT_STATIC_METHOD_CALL                                  'Foo', 'newVersion'
         32        DO_FCALL                                      0  $16     
         33        SEND_VAR                                                 $16
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Class Foo:
Function deprecatedversion:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MPjfN
function name:  deprecatedVersion
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_STATIC_METHOD_CALL                                  'newVersion'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    7     3*     > RETURN                                                   null

End of function deprecatedversion

Function newversion:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MPjfN
function name:  newVersion
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   'foo'
   12     1*     > RETURN                                                   null

End of function newversion

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.04 ms | 1400 KiB | 15 Q