3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '"Cat","A","A","A","A"'; $abc = [...json_decode("[$str]"), "A","Cat","Dog","A","Dog"]; print_r(array_count_values($abc));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NZkXe
function name:  (null)
number of ops:  22
compiled vars:  !0 = $str, !1 = $abc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%22Cat%22%2C%22A%22%2C%22A%22%2C%22A%22%2C%22A%22'
    5     1        INIT_FCALL                                               'json_decode'
          2        ROPE_INIT                                     3  ~4      '%5B'
          3        ROPE_ADD                                      1  ~4      ~4, !0
          4        ROPE_END                                      2  ~3      ~4, '%5D'
          5        SEND_VAL                                                 ~3
          6        DO_ICALL                                         $6      
          7        INIT_ARRAY                                       ~7      
          8        ADD_ARRAY_UNPACK                                 ~7      $6
          9        ADD_ARRAY_ELEMENT                                ~7      'A'
         10        ADD_ARRAY_ELEMENT                                ~7      'Cat'
         11        ADD_ARRAY_ELEMENT                                ~7      'Dog'
         12        ADD_ARRAY_ELEMENT                                ~7      'A'
         13        ADD_ARRAY_ELEMENT                                ~7      'Dog'
         14        ASSIGN                                                   !1, ~7
    6    15        INIT_FCALL                                               'print_r'
         16        INIT_FCALL                                               'array_count_values'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $9      
         19        SEND_VAR                                                 $9
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.17 ms | 1012 KiB | 16 Q