3v4l.org

run code in 500+ PHP versions simultaneously
<?php class StrWrap { public string $s = ''; } // Configuration du tableau pour piéger les pointeurs internes $obj = new StrWrap(); $data = array(); $data[0] = $obj; $data[1] = "different"; // Valide $a !== $b $data[2] = "encore_different"; // Valide $b !== $c // On utilise une référence classique pour forcer PHP à lier $data[1] au retour de prev // Ou plus simplement, on triche sur la sérialisation en forçant la structure attendue :
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e5PcQ
function name:  (null)
number of ops:  11
compiled vars:  !0 = $obj, !1 = $data
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   NEW                                                  $2      'StrWrap'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
    9     3        ASSIGN                                                       !1, <array>
   10     4        ASSIGN_DIM                                                   !1, 0
          5        OP_DATA                                                      !0
   11     6        ASSIGN_DIM                                                   !1, 1
          7        OP_DATA                                                      'different'
   12     8        ASSIGN_DIM                                                   !1, 2
          9        OP_DATA                                                      'encore_different'
   15    10      > RETURN                                                       1

Class StrWrap: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.59 ms | 1343 KiB | 13 Q