3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Something extends \SplFileObject { public function __toString() { return 'calling __toString'; } } $something = new Something('php://stdin'); echo $something; // 'calling __toString' echo (string) $something; // 'test.php' echo $something->__toString(); // 'calling __toString'
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vQsga
function name:  (null)
number of ops:  12
compiled vars:  !0 = $something
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'something', 'splfileobject'
    9     1        NEW                                                  $1      'Something'
          2        SEND_VAL_EX                                                  'php%3A%2F%2Fstdin'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $1
   10     5        ECHO                                                         !0
   11     6        CAST                                              6  ~4      !0
          7        ECHO                                                         ~4
   12     8        INIT_METHOD_CALL                                             !0, '__toString'
          9        DO_FCALL                                          0  $5      
         10        ECHO                                                         $5
         11      > RETURN                                                       1

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

End of function __tostring

End of class Something.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
205.31 ms | 2803 KiB | 13 Q