3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new class { function __toString() { return "_"; } }; var_dump(implode($a, ["a", "b"])); var_dump(implode(["a", "b"], $a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4FWBj
function name:  (null)
number of ops:  19
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_ANON_CLASS                               <unknown> 
          1        NEW                                              $2      $1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    7     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'implode'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 <array>
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                                 
    8    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'implode'
         13        SEND_VAL                                                 <array>
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $7      
         16        SEND_VAR                                                 $7
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

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

End of function __tostring

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.94 ms | 1001 KiB | 15 Q