3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_exception_handler(function($e) { echo "Error encountered: {$e->getMessage()}"; }); class ErrorMessageTest { public function isOk() { echo "This works okay. "; } public function isNotOkay() { echo "This will not work. "; throw new RuntimeException("Violets are red, roses are blue!! Wha!?!?"); } } $test = new ErrorMessageTest(); $test->isOk(); $test->isNotOkay();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RKCPe
function name:  (null)
number of ops:  12
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'set_exception_handler'
          1        DECLARE_LAMBDA_FUNCTION                          ~1      [0]
    5     2        SEND_VAL                                                 ~1
    3     3        DO_ICALL                                                 
   21     4        NEW                                              $3      'ErrorMessageTest'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   23     7        INIT_METHOD_CALL                                         !0, 'isOk'
          8        DO_FCALL                                      0          
   24     9        INIT_METHOD_CALL                                         !0, 'isNotOkay'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RKCPe
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        NOP                                                      
          2        INIT_METHOD_CALL                                         !0, 'getMessage'
          3        DO_FCALL                                      0  $1      
          4        FAST_CONCAT                                      ~2      'Error+encountered%3A+', $1
          5        ECHO                                                     ~2
    5     6      > RETURN                                                   null

End of Dynamic Function 0

Class ErrorMessageTest:
Function isok:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RKCPe
function name:  isOk
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     'This+works+okay.+'
   12     1      > RETURN                                                   null

End of function isok

Function isnotokay:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/RKCPe
function name:  isNotOkay
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'This+will+not+work.+'
   17     1        NEW                                              $0      'RuntimeException'
          2        SEND_VAL_EX                                              'Violets+are+red%2C+roses+are+blue%21%21+Wha%21%3F%21%3F'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $0
   18     5*     > RETURN                                                   null

End of function isnotokay

End of class ErrorMessageTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.62 ms | 1006 KiB | 14 Q