3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo { class Bar { public static function getBar() { return 'Bar'; } } echo "<h1>Bar: ".\Foo\Bar::getBar()."</h1>"; // outputs 'Bar: Bar' $function = '\Foo\Bar::getBar'; echo "<h1>Bar: ".$function()."</h1>"; // outputs 'Fatal error: Call to undefined function \Foo\Bar::getBar()' $function = '\Foo\Bar\getBar'; echo "<h1>Bar: ".$function()."</h1>"; // outputs 'Fatal error: Call to undefined function \foo\Bar\getBar()' }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iBERh
function name:  (null)
number of ops:  18
compiled vars:  !0 = $function
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_STATIC_METHOD_CALL                                  'Foo%5CBar', 'getBar'
          1        DO_FCALL                                      0  $1      
          2        CONCAT                                           ~2      '%3Ch1%3EBar%3A+', $1
          3        CONCAT                                           ~3      ~2, '%3C%2Fh1%3E'
          4        ECHO                                                     ~3
   11     5        ASSIGN                                                   !0, '%5CFoo%5CBar%3A%3AgetBar'
   12     6        INIT_DYNAMIC_CALL                                        !0
          7        DO_FCALL                                      0  $5      
          8        CONCAT                                           ~6      '%3Ch1%3EBar%3A+', $5
          9        CONCAT                                           ~7      ~6, '%3C%2Fh1%3E'
         10        ECHO                                                     ~7
   14    11        ASSIGN                                                   !0, '%5CFoo%5CBar%5CgetBar'
   15    12        INIT_DYNAMIC_CALL                                        !0
         13        DO_FCALL                                      0  $9      
         14        CONCAT                                           ~10     '%3Ch1%3EBar%3A+', $9
         15        CONCAT                                           ~11     ~10, '%3C%2Fh1%3E'
         16        ECHO                                                     ~11
   17    17      > RETURN                                                   1

Class Foo\Bar:
Function getbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iBERh
function name:  getBar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   'Bar'
    7     1*     > RETURN                                                   null

End of function getbar

End of class Foo\Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.99 ms | 1442 KiB | 13 Q