3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Hello { public function __toString() { throw new Exception("I broke it."); } } $h = new Hello(); echo " To string: " . $h . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h4WV3
function name:  (null)
number of ops:  8
compiled vars:  !0 = $h
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                                'hello'
   10     1        NEW                                                  $1      'Hello'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   11     4        CONCAT                                               ~4      '+To+string%3A+', !0
          5        CONCAT                                               ~5      ~4, '%0A'
          6        ECHO                                                         ~5
          7      > RETURN                                                       1

Class Hello:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/h4WV3
function name:  __toString
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   NEW                                                  $0      'Exception'
          1        SEND_VAL_EX                                                  'I+broke+it.'
          2        DO_FCALL                                          0          
          3      > THROW                                             0          $0
    7     4*       VERIFY_RETURN_TYPE                                           
          5*     > RETURN                                                       null

End of function __tostring

End of class Hello.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.32 ms | 2773 KiB | 13 Q