3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace HHVM\UserDocumentation\Inconsistencies\Intro\Examples\toStringExc; class A { public function __toString() { throw new \Exception('Not allowed in PHP'); return 'A'; } } $a = new A(); echo $a;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kgrk5
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'hhvm%5Cuserdocumentation%5Cinconsistencies%5Cintro%5Cexamples%5Ctostringexc%5Ca'
   12     1        NEW                                              $1      'HHVM%5CUserDocumentation%5CInconsistencies%5CIntro%5CExamples%5CtoStringExc%5CA'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   13     4        ECHO                                                     !0
          5      > RETURN                                                   1

Class HHVM\UserDocumentation\Inconsistencies\Intro\Examples\toStringExc\A:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/kgrk5
function name:  __toString
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $0      'Exception'
          1        SEND_VAL_EX                                              'Not+allowed+in+PHP'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
    8     4*       RETURN                                                   'A'
    9     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function __tostring

End of class HHVM\UserDocumentation\Inconsistencies\Intro\Examples\toStringExc\A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.85 ms | 1394 KiB | 13 Q