3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Stringable { public function __toString() {die ('hi'); return "A"; } } //var_dump(preg_replace('#A#si','B',$x=new Stringable())); $a=new SplStorageObject(); $a[1]=new Stringable(); echo(serialize($a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JGmQp
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'stringable'
   11     1        NEW                                              $1      'SplStorageObject'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   12     4        NEW                                              $5      'Stringable'
          5        DO_FCALL                                      0          
          6        ASSIGN_DIM                                               !0, 1
          7        OP_DATA                                                  $5
   13     8        INIT_FCALL                                               'serialize'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
         11        ECHO                                                     $7
         12      > RETURN                                                   1

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

End of function __tostring

End of class Stringable.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.43 ms | 1395 KiB | 15 Q