3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Why you don't want to get in the habbit of writing things like clone($foo)... * It might take away from the insight that clone takes an expression, which means * that something like (clone $foo . 'bar') and (clone ($foo . 'bar')) result in * different operator precedences. */ class foo { public function __tostring() { return "I am a foo!"; } } $foo = new foo; var_dump(clone $foo . 'bar'); //vs. clone($foo . 'bar') which evaluate to two totally different expressions...
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G8H7t
function name:  (null)
number of ops:  10
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_CLASS                                            'foo'
   16     1        NEW                                              $1      'foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   18     4        INIT_FCALL                                               'var_dump'
          5        CLONE                                            ~4      !0
          6        CONCAT                                           ~5      ~4, 'bar'
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class foo:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/G8H7t
function name:  __tostring
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   'I+am+a+foo%21'
   13     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:
146.57 ms | 1399 KiB | 15 Q