3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler('myErrorHandler'); register_shutdown_function('fatalErrorShutdownHandler'); echo 'Handler ..'; function myErrorHandler($code, $message, $file, $line) { } function fatalErrorShutdownHandler() { $last_error = error_get_last(); if ($last_error['type'] === E_ERROR) { // fatal error myErrorHandler(E_ERROR, $last_error['message'], $last_error['file'], $last_error['line']); } } final class valueobjectEmail { const EMAIL = "me@where.com"; static $p = "me@here.com"; // can't unset static property private $pp = "me@there.org"; // but may unset ppp properties function getProp(){ return valueobjectEmail::$p; } function setProp(){ valueobjectEmail::$p = 'blee'; } function getPropPP(){ return $this->pp; } function UnsetPP() { unset($this->pp); } private function __destruct() { return; } } $vo = new valueobjectEmail; var_dump($vo); echo $vo->getProp(),"\n"; $vo->setProp(); echo $vo->getProp(),"\n"; $vo2 = new valueobjectEmail; echo $vo == $vo2,"\n"; echo $vo === $vo2,"\n"; echo "\n",$vo2->getPropPP(),"\n"; $vo2->UnsetPP(); var_dump($vo2); echo $vo::EMAIL,"\n"; try { $vo = null; echo 'nullified',"\n"; } catch(Exception $e) { echo $e->getMessage(); } finally { echo "You may not destroy the value object","\n"; } var_dump($vo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
2 jumps found. (Code = 162) Position 1 = 56, Position 2 = 55
Branch analysis from position: 56
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 50
Branch analysis from position: 50
2 jumps found. (Code = 107) Position 1 = 51, Position 2 = -2
Branch analysis from position: 51
2 jumps found. (Code = 162) Position 1 = 56, Position 2 = 55
Branch analysis from position: 56
Branch analysis from position: 55
filename:       /in/nsJVZ
function name:  (null)
number of ops:  63
compiled vars:  !0 = $vo, !1 = $vo2, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'set_error_handler'
          1        SEND_VAL                                                 'myErrorHandler'
          2        DO_ICALL                                                 
    5     3        INIT_FCALL                                               'register_shutdown_function'
          4        SEND_VAL                                                 'fatalErrorShutdownHandler'
          5        DO_ICALL                                                 
    6     6        ECHO                                                     'Handler+..'
   43     7        NEW                                              $5      'valueobjectEmail'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !0, $5
   44    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   46    13        INIT_METHOD_CALL                                         !0, 'getProp'
         14        DO_FCALL                                      0  $9      
         15        ECHO                                                     $9
         16        ECHO                                                     '%0A'
   47    17        INIT_METHOD_CALL                                         !0, 'setProp'
         18        DO_FCALL                                      0          
   48    19        INIT_METHOD_CALL                                         !0, 'getProp'
         20        DO_FCALL                                      0  $11     
         21        ECHO                                                     $11
         22        ECHO                                                     '%0A'
   50    23        NEW                                              $12     'valueobjectEmail'
         24        DO_FCALL                                      0          
         25        ASSIGN                                                   !1, $12
   51    26        IS_EQUAL                                         ~15     !0, !1
         27        ECHO                                                     ~15
         28        ECHO                                                     '%0A'
   52    29        IS_IDENTICAL                                     ~16     !0, !1
         30        ECHO                                                     ~16
         31        ECHO                                                     '%0A'
   54    32        ECHO                                                     '%0A'
         33        INIT_METHOD_CALL                                         !1, 'getPropPP'
         34        DO_FCALL                                      0  $17     
         35        ECHO                                                     $17
         36        ECHO                                                     '%0A'
   55    37        INIT_METHOD_CALL                                         !1, 'UnsetPP'
         38        DO_FCALL                                      0          
   56    39        INIT_FCALL                                               'var_dump'
         40        SEND_VAR                                                 !1
         41        DO_ICALL                                                 
   57    42        FETCH_CLASS                                   0  $20     !0
         43        FETCH_CLASS_CONSTANT                             ~21     $20, 'EMAIL'
         44        ECHO                                                     ~21
         45        ECHO                                                     '%0A'
   59    46        ASSIGN                                                   !0, null
   60    47        ECHO                                                     'nullified'
         48        ECHO                                                     '%0A'
         49      > JMP                                                      ->54
   61    50  E > > CATCH                                       last         'Exception'
   62    51    >   INIT_METHOD_CALL                                         !2, 'getMessage'
         52        DO_FCALL                                      0  $24     
         53        ECHO                                                     $24
   63    54    > > FAST_CALL                                                ->56
         55    > > JMP                                                      ->59
   64    56    >   ECHO                                                     'You+may+not+destroy+the+value+object'
         57        ECHO                                                     '%0A'
         58      > FAST_RET                                                 
   66    59    >   INIT_FCALL                                               'var_dump'
         60        SEND_VAR                                                 !0
         61        DO_ICALL                                                 
         62      > RETURN                                                   1

Function myerrorhandler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nsJVZ
function name:  myErrorHandler
number of ops:  5
compiled vars:  !0 = $code, !1 = $message, !2 = $file, !3 = $line
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    9     4      > RETURN                                                   null

End of function myerrorhandler

Function fatalerrorshutdownhandler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/nsJVZ
function name:  fatalErrorShutdownHandler
number of ops:  16
compiled vars:  !0 = $last_error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'error_get_last'
          1        DO_ICALL                                         $1      
          2        ASSIGN                                                   !0, $1
   14     3        FETCH_DIM_R                                      ~3      !0, 'type'
          4        IS_IDENTICAL                                             ~3, 1
          5      > JMPZ                                                     ~4, ->15
   16     6    >   INIT_FCALL                                               'myerrorhandler'
          7        SEND_VAL                                                 1
          8        FETCH_DIM_R                                      ~5      !0, 'message'
          9        SEND_VAL                                                 ~5
         10        FETCH_DIM_R                                      ~6      !0, 'file'
         11        SEND_VAL                                                 ~6
         12        FETCH_DIM_R                                      ~7      !0, 'line'
         13        SEND_VAL                                                 ~7
         14        DO_FCALL                                      0          
   18    15    > > RETURN                                                   null

End of function fatalerrorshutdownhandler

Class valueobjectEmail:
Function getprop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nsJVZ
function name:  getProp
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'p'
          1      > RETURN                                                   ~0
   29     2*     > RETURN                                                   null

End of function getprop

Function setprop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nsJVZ
function name:  setProp
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   ASSIGN_STATIC_PROP                                       'p', 'valueobjectEmail'
          1        OP_DATA                                                  'blee'
   32     2      > RETURN                                                   null

End of function setprop

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

End of function getproppp

Function unsetpp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nsJVZ
function name:  UnsetPP
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   UNSET_OBJ                                                'pp'
   38     1      > RETURN                                                   null

End of function unsetpp

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nsJVZ
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E > > RETURN                                                   null
   41     1*     > RETURN                                                   null

End of function __destruct

End of class valueobjectEmail.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.05 ms | 1406 KiB | 22 Q