3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler('myErrorHandler'); register_shutdown_function('fatalErrorShutdownHandler'); 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 false; } } $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; } catch(Exception $e) { echo $e; } 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 = 49
Branch analysis from position: 49
2 jumps found. (Code = 162) Position 1 = 51, Position 2 = 50
Branch analysis from position: 51
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 47
Branch analysis from position: 47
2 jumps found. (Code = 107) Position 1 = 48, Position 2 = -2
Branch analysis from position: 48
2 jumps found. (Code = 162) Position 1 = 51, Position 2 = 50
Branch analysis from position: 51
Branch analysis from position: 50
filename:       /in/DRDII
function name:  (null)
number of ops:  58
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                                                 
   43     6        NEW                                              $5      'valueobjectEmail'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !0, $5
   44     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   46    12        INIT_METHOD_CALL                                         !0, 'getProp'
         13        DO_FCALL                                      0  $9      
         14        ECHO                                                     $9
         15        ECHO                                                     '%0A'
   47    16        INIT_METHOD_CALL                                         !0, 'setProp'
         17        DO_FCALL                                      0          
   48    18        INIT_METHOD_CALL                                         !0, 'getProp'
         19        DO_FCALL                                      0  $11     
         20        ECHO                                                     $11
         21        ECHO                                                     '%0A'
   50    22        NEW                                              $12     'valueobjectEmail'
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !1, $12
   51    25        IS_EQUAL                                         ~15     !0, !1
         26        ECHO                                                     ~15
         27        ECHO                                                     '%0A'
   52    28        IS_IDENTICAL                                     ~16     !0, !1
         29        ECHO                                                     ~16
         30        ECHO                                                     '%0A'
   54    31        ECHO                                                     '%0A'
         32        INIT_METHOD_CALL                                         !1, 'getPropPP'
         33        DO_FCALL                                      0  $17     
         34        ECHO                                                     $17
         35        ECHO                                                     '%0A'
   55    36        INIT_METHOD_CALL                                         !1, 'UnsetPP'
         37        DO_FCALL                                      0          
   56    38        INIT_FCALL                                               'var_dump'
         39        SEND_VAR                                                 !1
         40        DO_ICALL                                                 
   57    41        FETCH_CLASS                                   0  $20     !0
         42        FETCH_CLASS_CONSTANT                             ~21     $20, 'EMAIL'
         43        ECHO                                                     ~21
         44        ECHO                                                     '%0A'
   59    45        ASSIGN                                                   !0, null
         46      > JMP                                                      ->49
   60    47  E > > CATCH                                       last         'Exception'
   61    48    >   ECHO                                                     !2
   62    49    > > FAST_CALL                                                ->51
         50    > > JMP                                                      ->54
   63    51    >   ECHO                                                     'You+may+not+destroy+the+value+object'
         52        ECHO                                                     '%0A'
         53      > FAST_RET                                                 
   65    54    >   INIT_FCALL                                               'var_dump'
         55        SEND_VAR                                                 !0
         56        DO_ICALL                                                 
         57      > RETURN                                                   1

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

End of function __destruct

End of class valueobjectEmail.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
199.78 ms | 1407 KiB | 22 Q