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(); try { echo $a; } catch (\Exception $ex) { echo "Exception will not be thrown to here in PHP"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XHDP8
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a, !1 = $ex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                            'hhvm%5Cuserdocumentation%5Cinconsistencies%5Cintro%5Cexamples%5Ctostringexc%5Ca'
   12     1        NEW                                              $2      'HHVM%5CUserDocumentation%5CInconsistencies%5CIntro%5CExamples%5CtoStringExc%5CA'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   14     4        ECHO                                                     !0
          5      > JMP                                                      ->8
   15     6  E > > CATCH                                       last         'Exception'
   16     7    >   ECHO                                                     'Exception+will+not+be+thrown+to+here+in+PHP'
   17     8    > > 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/XHDP8
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:
149.11 ms | 1394 KiB | 13 Q