3v4l.org

run code in 300+ PHP versions simultaneously
<?php //the original array $a = array( 'a23' => 'abcdefg hij' ); //make it serial $s = serialize($a); //just to see the serial string var_dump($s); //the serialized array $s1 = 'a:1:{s:3:"a23";s:11:"abcdefg hij";}'; //the same with linux line end character $s2 = "a:1:{s:3:\"a23\";s:11:\"abcdefg\12hij\";}"; //the same with windows line end character, same I had in my PEAR files $s3 = "a:1:{s:3:\"a23\";s:11:\"abcdefg\15\12hij\";}"; //turn it back to an array $a1 = unserialize($s1); // ok $a2 = unserialize($s2); // ok $a3 = unserialize($s3); // not ok
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X0pFQ
function name:  (null)
number of ops:  24
compiled vars:  !0 = $a, !1 = $s, !2 = $s1, !3 = $s2, !4 = $s3, !5 = $a1, !6 = $a2, !7 = $a3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'serialize'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $9      
          4        ASSIGN                                                   !1, $9
   11     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
   13     8        ASSIGN                                                   !2, 'a%3A1%3A%7Bs%3A3%3A%22a23%22%3Bs%3A11%3A%22abcdefg%0Ahij%22%3B%7D'
   16     9        ASSIGN                                                   !3, 'a%3A1%3A%7Bs%3A3%3A%22a23%22%3Bs%3A11%3A%22abcdefg%0Ahij%22%3B%7D'
   18    10        ASSIGN                                                   !4, 'a%3A1%3A%7Bs%3A3%3A%22a23%22%3Bs%3A11%3A%22abcdefg%0D%0Ahij%22%3B%7D'
   20    11        INIT_FCALL                                               'unserialize'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $15     
         14        ASSIGN                                                   !5, $15
   21    15        INIT_FCALL                                               'unserialize'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                         $17     
         18        ASSIGN                                                   !6, $17
   22    19        INIT_FCALL                                               'unserialize'
         20        SEND_VAR                                                 !4
         21        DO_ICALL                                         $19     
         22        ASSIGN                                                   !7, $19
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.43 ms | 1447 KiB | 16 Q