3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); class Foo { public function __toString(): string { return 'foo'; } public function bar(): string { return 'bar'; } } $o = new Foo(); echo "$o->bar() / {$o->bar()}";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VALlY
function name:  (null)
number of ops:  15
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 0
          2        DO_ICALL                                                 
    5     3        DECLARE_CLASS                                            'foo'
   15     4        NEW                                              $2      'Foo'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $2
   17     7        FETCH_OBJ_R                                      ~5      !0, 'bar'
          8        ROPE_INIT                                     3  ~8      ~5
          9        ROPE_ADD                                      1  ~8      ~8, '%28%29+%2F+'
         10        INIT_METHOD_CALL                                         !0, 'bar'
         11        DO_FCALL                                      0  $6      
         12        ROPE_END                                      2  ~7      ~8, $6
         13        ECHO                                                     ~7
         14      > RETURN                                                   1

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

End of function __tostring

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VALlY
function name:  bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   'bar'
   12     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:
184.55 ms | 1395 KiB | 15 Q