3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 簡単なクラスを宣言 class TestClass { public $foo; private $debug = false; public function __construct($foo) { $this->foo = $foo; } public function myDo() { return $this->debug; } public function __destruct() { if($this->debug) { echo "YES!!"; } } } $class = new TestClass('Hello'); //$ser = serialize($class); $ser = serialize("O:9:&quot;TestClass&quot;:2:{s:14:&quot;TestClassfoo&quot;;s:5:&quot;Hello&quot;;s:16:&quot;TestClassdebug&quot;;b:1;}"); $deser = unserialize($ser); if ($deser === FALSE) { echo "error."; } echo $class->foo; print ((true === $class->myDo()) ? 'true' : 'false' ) . PHP_EOL; //echo $class->debug; //echo htmlspecialchars(serialize($deser)); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/EB2dO
function name:  (null)
number of ops:  27
compiled vars:  !0 = $class, !1 = $ser, !2 = $deser
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $3      'TestClass'
          1        SEND_VAL_EX                                              'Hello'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   26     4        INIT_FCALL                                               'serialize'
          5        SEND_VAL                                                 'O%3A9%3A%26quot%3BTestClass%26quot%3B%3A2%3A%7Bs%3A14%3A%26quot%3BTestClassfoo%26quot%3B%3Bs%3A5%3A%26quot%3BHello%26quot%3B%3Bs%3A16%3A%26quot%3BTestClassdebug%26quot%3B%3Bb%3A1%3B%7D'
          6        DO_ICALL                                         $6      
          7        ASSIGN                                                   !1, $6
   27     8        INIT_FCALL                                               'unserialize'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !2, $8
   28    12        TYPE_CHECK                                    4          !2
         13      > JMPZ                                                     ~10, ->15
   29    14    >   ECHO                                                     'error.'
   31    15    >   FETCH_OBJ_R                                      ~11     !0, 'foo'
         16        ECHO                                                     ~11
   32    17        INIT_METHOD_CALL                                         !0, 'myDo'
         18        DO_FCALL                                      0  $12     
         19        TYPE_CHECK                                    8          $12
         20      > JMPZ                                                     ~13, ->23
         21    >   QM_ASSIGN                                        ~14     'true'
         22      > JMP                                                      ->24
         23    >   QM_ASSIGN                                        ~14     'false'
         24    >   CONCAT                                           ~15     ~14, '%0A'
         25        ECHO                                                     ~15
   35    26      > RETURN                                                   1

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

End of function __construct

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

End of function mydo

Function __destruct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 3
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
filename:       /in/EB2dO
function name:  __destruct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_OBJ_R                                      ~0      'debug'
          1      > JMPZ                                                     ~0, ->3
   19     2    >   ECHO                                                     'YES%21%21'
   21     3    > > RETURN                                                   null

End of function __destruct

End of class TestClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.8 ms | 1400 KiB | 17 Q