3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { public $inner = NULL; protected $prot = 1; private $priv = 2; } $one = new test; $two = new test; $one->inner = $two; $two->inner = $one; for($i = 100; $i > 0; $i--) { $serialized = preg_replace('/O:\d:"([^"]*)":/i', 'O:8:"stdClass":', serialize($one)); $storage = json_encode(unserialize(preg_replace_callback('/s:(\d+):"\x00([^"\x00]+)\x00([^"]+)"/i', function($matches) { return 's:'.($matches[1]-(strlen($matches[2])+2)).':"'.$matches[3].'"'; }, $serialized))); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 12
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 12
Branch analysis from position: 37
Branch analysis from position: 12
filename:       /in/hVhRY
function name:  (null)
number of ops:  38
compiled vars:  !0 = $one, !1 = $two, !2 = $i, !3 = $serialized, !4 = $storage
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $5      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
   10     3        NEW                                              $8      'test'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $8
   11     6        ASSIGN_OBJ                                               !0, 'inner'
          7        OP_DATA                                                  !1
   12     8        ASSIGN_OBJ                                               !1, 'inner'
          9        OP_DATA                                                  !0
   14    10        ASSIGN                                                   !2, 100
         11      > JMP                                                      ->35
   15    12    >   INIT_FCALL                                               'preg_replace'
         13        SEND_VAL                                                 '%2FO%3A%5Cd%3A%22%28%5B%5E%22%5D%2A%29%22%3A%2Fi'
         14        SEND_VAL                                                 'O%3A8%3A%22stdClass%22%3A'
         15        INIT_FCALL                                               'serialize'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $14     
         18        SEND_VAR                                                 $14
         19        DO_ICALL                                         $15     
         20        ASSIGN                                                   !3, $15
   16    21        INIT_FCALL                                               'json_encode'
         22        INIT_FCALL                                               'unserialize'
         23        INIT_FCALL                                               'preg_replace_callback'
         24        SEND_VAL                                                 '%2Fs%3A%28%5Cd%2B%29%3A%22%5Cx00%28%5B%5E%22%5Cx00%5D%2B%29%5Cx00%28%5B%5E%22%5D%2B%29%22%2Fi'
   17    25        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhVhRY%3A17%240'
         26        SEND_VAL                                                 ~17
   18    27        SEND_VAR                                                 !3
         28        DO_ICALL                                         $18     
         29        SEND_VAR                                                 $18
         30        DO_ICALL                                         $19     
         31        SEND_VAR                                                 $19
         32        DO_ICALL                                         $20     
   16    33        ASSIGN                                                   !4, $20
   14    34        PRE_DEC                                                  !2
         35    >   IS_SMALLER                                               0, !2
         36      > JMPNZ                                                    ~23, ->12
   19    37    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FhVhRY%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hVhRY
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        FETCH_DIM_R                                      ~1      !0, 1
          2        FETCH_DIM_R                                      ~2      !0, 2
          3        STRLEN                                           ~3      ~2
          4        ADD                                              ~4      ~3, 2
          5        SUB                                              ~5      ~1, ~4
          6        CONCAT                                           ~6      's%3A', ~5
          7        CONCAT                                           ~7      ~6, '%3A%22'
          8        FETCH_DIM_R                                      ~8      !0, 3
          9        CONCAT                                           ~9      ~7, ~8
         10        CONCAT                                           ~10     ~9, '%22'
         11      > RETURN                                                   ~10
         12*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FhVhRY%3A17%240

Class test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.79 ms | 1400 KiB | 23 Q