3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string="[2422996,2422996,2422996,2422996]"; $jsobj=json_decode($string); if(array_search(2422996,$jsobj,true)===false){ array_push($jsobj,2422996); $jsobj=json_encode($jsobj); print_r($jsobj); print('Complimenti, sei iscritto alle news, ti manderemo tutte le novità'); }else{ print('Sei già iscritto alle News'); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 25
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UFdKs
function name:  (null)
number of ops:  27
compiled vars:  !0 = $string, !1 = $jsobj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%5B2422996%2C2422996%2C2422996%2C2422996%5D'
    3     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
    4     5        INIT_FCALL                                               'array_search'
          6        SEND_VAL                                                 2422996
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $5      
         10        TYPE_CHECK                                    4          $5
         11      > JMPZ                                                     ~6, ->25
    5    12    >   INIT_FCALL                                               'array_push'
         13        SEND_REF                                                 !1
         14        SEND_VAL                                                 2422996
         15        DO_ICALL                                                 
    6    16        INIT_FCALL                                               'json_encode'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $8      
         19        ASSIGN                                                   !1, $8
    7    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
    8    23        ECHO                                                     'Complimenti%2C+sei+iscritto+alle+news%2C+ti+manderemo+tutte+le+novit%C3%A0'
         24      > JMP                                                      ->26
   10    25    >   ECHO                                                     'Sei+gi%C3%A0+iscritto+alle+News'
   12    26    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.98 ms | 1395 KiB | 23 Q