3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bar() { echo "da blyaaa\n"; } $bar = function() { echo "voobshe ohuet\n"; }; class Foo { public const bar = 'bar'; public static string $bar = 'bar'; public function bar(): string { return 'bar'; } } $foo = new Foo; echo "1) This is {Foo::$bar}\n"; echo "2) This is {$foo::$bar()}\n"; echo "3) This is {Foo::bar}\n"; echo "4) This is {Foo->bar()}\n"; echo "5) This is {$foo->bar()}\n"; echo "6) This is ${Foo::bar}\n"; echo "7) This is ${Foo::$bar}\n"; echo "8) This is {$foo::bar()}\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QBVVf
function name:  (null)
number of ops:  43
compiled vars:  !0 = $bar, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_LAMBDA_FUNCTION                          ~2      [0]
          1        ASSIGN                                                   !0, ~2
   20     2        NEW                                              $4      'Foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   22     5        ROPE_INIT                                     3  ~8      '1%29+This+is+%7BFoo%3A%3A'
          6        ROPE_ADD                                      1  ~8      ~8, !0
          7        ROPE_END                                      2  ~7      ~8, '%7D%0A'
          8        ECHO                                                     ~7
   23     9        ROPE_INIT                                     3  ~13     '2%29+This+is+'
         10        FETCH_CLASS                                   0  $10     !1
         11        INIT_STATIC_METHOD_CALL                                  $10, !0
         12        DO_FCALL                                      0  $11     
         13        ROPE_ADD                                      1  ~13     ~13, $11
         14        ROPE_END                                      2  ~12     ~13, '%0A'
         15        ECHO                                                     ~12
   24    16        ECHO                                                     '3%29+This+is+%7BFoo%3A%3Abar%7D%0A'
   25    17        ECHO                                                     '4%29+This+is+%7BFoo-%3Ebar%28%29%7D%0A'
   26    18        ROPE_INIT                                     3  ~17     '5%29+This+is+'
         19        INIT_METHOD_CALL                                         !1, 'bar'
         20        DO_FCALL                                      0  $15     
         21        ROPE_ADD                                      1  ~17     ~17, $15
         22        ROPE_END                                      2  ~16     ~17, '%0A'
         23        ECHO                                                     ~16
   27    24        ROPE_INIT                                     3  ~21     '6%29+This+is+'
         25        FETCH_R                      local               ~19     'bar'
         26        ROPE_ADD                                      1  ~21     ~21, ~19
         27        ROPE_END                                      2  ~20     ~21, '%0A'
         28        ECHO                                                     ~20
   28    29        ROPE_INIT                                     3  ~26     '7%29+This+is+'
         30        FETCH_STATIC_PROP_R          unknown             ~23     'bar'
         31        FETCH_R                      local               ~24     ~23
         32        ROPE_ADD                                      1  ~26     ~26, ~24
         33        ROPE_END                                      2  ~25     ~26, '%0A'
         34        ECHO                                                     ~25
   29    35        ROPE_INIT                                     3  ~31     '8%29+This+is+'
         36        FETCH_CLASS                                   0  $28     !1
         37        INIT_STATIC_METHOD_CALL                                  $28, 'bar'
         38        DO_FCALL                                      0  $29     
         39        ROPE_ADD                                      1  ~31     ~31, $29
         40        ROPE_END                                      2  ~30     ~31, '%0A'
         41        ECHO                                                     ~30
         42      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QBVVf
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ECHO                                                     'voobshe+ohuet%0A'
    9     1      > RETURN                                                   null

End of Dynamic Function 0

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QBVVf
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'da+blyaaa%0A'
    5     1      > RETURN                                                   null

End of function bar

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QBVVf
function name:  bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   'bar'
   17     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.92 ms | 1000 KiB | 13 Q