3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { public function __toString() { return "A"; } } echo str_replace(new C, new C, new C);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HFCpv
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'c'
   12     1        INIT_FCALL                                               'str_replace'
          2        NEW                                              $0      'C'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $0
          5        NEW                                              $2      'C'
          6        DO_FCALL                                      0          
          7        SEND_VAR                                                 $2
          8        NEW                                              $4      'C'
          9        DO_FCALL                                      0          
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                         $6      
         12        ECHO                                                     $6
         13      > RETURN                                                   1

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

End of function __tostring

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.27 ms | 1395 KiB | 15 Q