3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __toString() { return 'bar'; } } var_dump(implode(', ', [new Foo, new Foo]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Yjtgh
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo'
    8     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'implode'
          3        SEND_VAL                                                 '%2C+'
          4        NEW                                              $0      'Foo'
          5        DO_FCALL                                      0          
          6        INIT_ARRAY                                       ~2      $0
          7        NEW                                              $3      'Foo'
          8        DO_FCALL                                      0          
          9        ADD_ARRAY_ELEMENT                                ~2      $3
         10        SEND_VAL                                                 ~2
         11        DO_ICALL                                         $5      
         12        SEND_VAR                                                 $5
         13        DO_ICALL                                                 
         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/Yjtgh
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'bar'
          1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function __tostring

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.55 ms | 1399 KiB | 17 Q