3v4l.org

run code in 300+ PHP versions simultaneously
<?php register_shutdown_function('shutdownFunction'); function shutDownFunction() { $error = error_get_last(); if ($error['type'] == 1) { //do your stuff } } 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) { } 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 = 45
Branch analysis from position: 45
2 jumps found. (Code = 162) Position 1 = 47, Position 2 = 46
Branch analysis from position: 47
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 44
Branch analysis from position: 44
2 jumps found. (Code = 107) Position 1 = 45, Position 2 = -2
Branch analysis from position: 45
filename:       /in/k6Bra
function name:  (null)
number of ops:  54
compiled vars:  !0 = $vo, !1 = $vo2, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'register_shutdown_function'
          1        SEND_VAL                                                 'shutdownFunction'
          2        DO_ICALL                                                 
   33     3        NEW                                              $4      'valueobjectEmail'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $4
   34     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   36     9        INIT_METHOD_CALL                                         !0, 'getProp'
         10        DO_FCALL                                      0  $8      
         11        ECHO                                                     $8
         12        ECHO                                                     '%0A'
   37    13        INIT_METHOD_CALL                                         !0, 'setProp'
         14        DO_FCALL                                      0          
   38    15        INIT_METHOD_CALL                                         !0, 'getProp'
         16        DO_FCALL                                      0  $10     
         17        ECHO                                                     $10
         18        ECHO                                                     '%0A'
   40    19        NEW                                              $11     'valueobjectEmail'
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !1, $11
   41    22        IS_EQUAL                                         ~14     !0, !1
         23        ECHO                                                     ~14
         24        ECHO                                                     '%0A'
   42    25        IS_IDENTICAL                                     ~15     !0, !1
         26        ECHO                                                     ~15
         27        ECHO                                                     '%0A'
   44    28        ECHO                                                     '%0A'
         29        INIT_METHOD_CALL                                         !1, 'getPropPP'
         30        DO_FCALL                                      0  $16     
         31        ECHO                                                     $16
         32        ECHO                                                     '%0A'
   45    33        INIT_METHOD_CALL                                         !1, 'UnsetPP'
         34        DO_FCALL                                      0          
   46    35        INIT_FCALL                                               'var_dump'
         36        SEND_VAR                                                 !1
         37        DO_ICALL                                                 
   47    38        FETCH_CLASS                                   0  $19     !0
         39        FETCH_CLASS_CONSTANT                             ~20     $19, 'EMAIL'
         40        ECHO                                                     ~20
         41        ECHO                                                     '%0A'
   49    42        ASSIGN                                                   !0, null
         43      > JMP                                                      ->45
   50    44  E > > CATCH                                       last         'Exception'
   52    45    > > FAST_CALL                                                ->47
         46    > > JMP                                                      ->50
   53    47    >   ECHO                                                     'You+may+not+destroy+the+value+object'
         48        ECHO                                                     '%0A'
         49      > FAST_RET                                                 
   55    50    >   INIT_FCALL                                               'var_dump'
         51        SEND_VAR                                                 !0
         52        DO_ICALL                                                 
         53      > RETURN                                                   1

Function shutdownfunction:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/k6Bra
function name:  shutDownFunction
number of ops:  7
compiled vars:  !0 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'error_get_last'
          1        DO_ICALL                                         $1      
          2        ASSIGN                                                   !0, $1
    7     3        FETCH_DIM_R                                      ~3      !0, 'type'
          4        IS_EQUAL                                                 ~3, 1
          5      > JMPZ                                                     ~4, ->6
   10     6    > > RETURN                                                   null

End of function shutdownfunction

Class valueobjectEmail:
Function getprop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k6Bra
function name:  getProp
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'p'
          1      > RETURN                                                   ~0
   19     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/k6Bra
function name:  setProp
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ASSIGN_STATIC_PROP                                       'p', 'valueobjectEmail'
          1        OP_DATA                                                  'blee'
   22     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/k6Bra
function name:  getPropPP
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   FETCH_OBJ_R                                      ~0      'pp'
          1      > RETURN                                                   ~0
   25     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/k6Bra
function name:  UnsetPP
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   UNSET_OBJ                                                'pp'
   28     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/k6Bra
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E > > RETURN                                                   <false>
   31     1*     > RETURN                                                   null

End of function __destruct

End of class valueobjectEmail.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.64 ms | 1404 KiB | 19 Q