3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ContextException extends RuntimeException { protected $context = array(); public function __construct($message='', $context=array(), $code=0, $previous=null) { $this->context = $context; parent::__construct($message, $code, $previous); } /** * Returns an array of variables that existed when exception occured. * @return array Array of variable name=>value pairs. */ public function getContext(){ return $this->context; } } $cheese = true; throw new ContextException('Something went wrong.', get_defined_vars(), E_NOTICE);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/hTpLR
function name:  (null)
number of ops:  10
compiled vars:  !0 = $cheese
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   ASSIGN                                                   !0, <true>
   24     1        NEW                                              $2      'ContextException'
          2        SEND_VAL_EX                                              'Something+went+wrong.'
          3        INIT_FCALL                                               'get_defined_vars'
          4        DO_ICALL                                         $3      
          5        SEND_VAR_NO_REF_EX                                       $3
          6        SEND_VAL_EX                                              8
          7        DO_FCALL                                      0          
          8      > THROW                                         0          $2
          9*     > RETURN                                                   1

Class ContextException:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hTpLR
function name:  __construct
number of ops:  12
compiled vars:  !0 = $message, !1 = $context, !2 = $code, !3 = $previous
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV_INIT                                        !0      ''
          1        RECV_INIT                                        !1      <array>
          2        RECV_INIT                                        !2      0
          3        RECV_INIT                                        !3      null
    8     4        ASSIGN_OBJ                                               'context'
          5        OP_DATA                                                  !1
    9     6        INIT_STATIC_METHOD_CALL                                  
          7        SEND_VAR_EX                                              !0
          8        SEND_VAR_EX                                              !2
          9        SEND_VAR_EX                                              !3
         10        DO_FCALL                                      0          
   10    11      > RETURN                                                   null

End of function __construct

Function getcontext:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hTpLR
function name:  getContext
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      'context'
          1      > RETURN                                                   ~0
   18     2*     > RETURN                                                   null

End of function getcontext

End of class ContextException.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.33 ms | 1396 KiB | 15 Q