3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class SensitiveValue implements \Serializable { private $value; /** * @param mixed $value */ final public function __construct($value) { $this->value = $value; } /** * @return mixed */ public function peek() { return $this->value; } /** * @return mixed */ public function get() { $value = $this->value; $this->erase(); return $value; } public function erase() { $this->value = null; } /** * {@inheritDoc} */ public function serialize() { return; } /** * {@inheritDoc} */ public function unserialize($serialized) { } /** * {@inheritDoc} */ public function __toString() { return ''; } /** * {@inheritDoc} */ public function __clone() { throw new \Exception('It is not permitted to clone this object.'); } } $value = new SensitiveValue(new \DateTime()); $time = $value->get(); echo $value->get()->format('Y-m-d');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Yk7kd
function name:  (null)
number of ops:  17
compiled vars:  !0 = $value, !1 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'sensitivevalue'
   62     1        NEW                                              $2      'SensitiveValue'
          2        NEW                                              $3      'DateTime'
          3        DO_FCALL                                      0          
          4        SEND_VAR_NO_REF_EX                                       $3
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $2
   63     7        INIT_METHOD_CALL                                         !0, 'get'
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !1, $7
   65    10        INIT_METHOD_CALL                                         !0, 'get'
         11        DO_FCALL                                      0  $9      
         12        INIT_METHOD_CALL                                         $9, 'format'
         13        SEND_VAL_EX                                              'Y-m-d'
         14        DO_FCALL                                      0  $10     
         15        ECHO                                                     $10
         16      > RETURN                                                   1

Class SensitiveValue:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Yk7kd
function name:  __construct
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        ASSIGN_OBJ                                               'value'
          2        OP_DATA                                                  !0
   12     3      > RETURN                                                   null

End of function __construct

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

End of function peek

Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Yk7kd
function name:  get
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~1      'value'
          1        ASSIGN                                                   !0, ~1
   26     2        INIT_METHOD_CALL                                         'erase'
          3        DO_FCALL                                      0          
   27     4      > RETURN                                                   !0
   28     5*     > RETURN                                                   null

End of function get

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

End of function erase

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

End of function serialize

Function unserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Yk7kd
function name:  unserialize
number of ops:  2
compiled vars:  !0 = $serialized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   RECV                                             !0      
   45     1      > RETURN                                                   null

End of function unserialize

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Yk7kd
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E > > RETURN                                                   ''
   52     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function __tostring

Function __clone:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/Yk7kd
function name:  __clone
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   58     0  E >   NEW                                              $0      'Exception'
          1        SEND_VAL_EX                                              'It+is+not+permitted+to+clone+this+object.'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
   59     4*     > RETURN                                                   null

End of function __clone

End of class SensitiveValue.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.17 ms | 1399 KiB | 13 Q