3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encode_string_array ($stringArray) { $s = strtr(base64_encode(addslashes(gzcompress(serialize($stringArray),9))), '+/=', '-_,'); return $s; } function decode_string_array ($stringArray) { $s = unserialize(gzuncompress(stripslashes(base64_decode(strtr($stringArray, '-_,', '+/='))))); return $s; } $string = '{ "head": [ { "FormId": "FR100400061", "CatchDate": "2016-01-25T12:17:57", "TravelerId": "80222557", "TravelerName": "El gio gonzales", "Status": 1, "CustAccount": "1004", "CustName": "Court de Tennis", "Middleman": "1008", "MiddlemanName": "Wide World Importers", "DataAreaId": "frrt", "CreatedBy": "123", "CreatedDateTime": "2016-01-25T12:17:57" } ], "lines": [ { "ItemId": "IVA21", "FamilyId": "", "FamilyDescription": "Zapatitos", "TotalVal": 123.0, "TaxVal": 21.35, "BaseVal": 101.65, "FormId": "FR100400061", "RefundVal": 13.0, "DataAreaId": "frrt" } ], "traveler": [ { "TravelerId": "80222557", "Email": "garanda21@gmail.com", "Name": "El gio gonzales", "Country": "PE", "CountryName": "Peru", "Address": "Calle de abaja bien abajo", "Gender": 1, "Birthdate": "23/12/1982" } ]}'; $pass = '1234'; $method = 'aes128'; $iv = "1234567812345678"; $str = "sample data"; $bzstr = bzcompress($string, 9); echo $bzstr; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dP7in
function name:  (null)
number of ops:  12
compiled vars:  !0 = $string, !1 = $pass, !2 = $method, !3 = $iv, !4 = $str, !5 = $bzstr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, '%7B++%22head%22%3A+%5B++++%7B++++++%22FormId%22%3A+%22FR100400061%22%2C++++++%22CatchDate%22%3A+%222016-01-25T12%3A17%3A57%22%2C++++++%22TravelerId%22%3A+%2280222557%22%2C++++++%22TravelerName%22%3A+%22El+gio+gonzales%22%2C++++++%22Status%22%3A+1%2C++++++%22CustAccount%22%3A+%221004%22%2C++++++%22CustName%22%3A+%22Court+de+Tennis%22%2C++++++%22Middleman%22%3A+%221008%22%2C++++++%22MiddlemanName%22%3A+%22Wide+World+Importers%22%2C++++++%22DataAreaId%22%3A+%22frrt%22%2C++++++%22CreatedBy%22%3A+%22123%22%2C++++++%22CreatedDateTime%22%3A+%222016-01-25T12%3A17%3A57%22++++%7D++%5D%2C++%22lines%22%3A+%5B++++%7B++++++%22ItemId%22%3A+%22IVA21%22%2C++++++%22FamilyId%22%3A+%22%22%2C++++++%22FamilyDescription%22%3A+%22Zapatitos%22%2C++++++%22TotalVal%22%3A+123.0%2C++++++%22TaxVal%22%3A+21.35%2C++++++%22BaseVal%22%3A+101.65%2C++++++%22FormId%22%3A+%22FR100400061%22%2C++++++%22RefundVal%22%3A+13.0%2C++++++%22DataAreaId%22%3A+%22frrt%22++++%7D++%5D%2C++%22traveler%22%3A+%5B++++%7B++++++%22TravelerId%22%3A+%2280222557%22%2C++++++%22Email%22%3A+%22garanda21%40gmail.com%22%2C++++++%22Name%22%3A+%22El+gio+gonzales%22%2C++++++%22Country%22%3A+%22PE%22%2C++++++%22CountryName%22%3A+%22Peru%22%2C++++++%22Address%22%3A+%22Calle+de+abaja+bien+abajo%22%2C++++++%22Gender%22%3A+1%2C++++++%22Birthdate%22%3A+%2223%2F12%2F1982%22++++%7D++%5D%7D'
   13     1        ASSIGN                                                   !1, '1234'
   14     2        ASSIGN                                                   !2, 'aes128'
   15     3        ASSIGN                                                   !3, '1234567812345678'
   17     4        ASSIGN                                                   !4, 'sample+data'
   18     5        INIT_FCALL_BY_NAME                                       'bzcompress'
          6        SEND_VAR_EX                                              !0
          7        SEND_VAL_EX                                              9
          8        DO_FCALL                                      0  $11     
          9        ASSIGN                                                   !5, $11
   19    10        ECHO                                                     !5
   21    11      > RETURN                                                   1

Function encode_string_array:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dP7in
function name:  encode_string_array
number of ops:  22
compiled vars:  !0 = $stringArray, !1 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'strtr'
          2        INIT_FCALL                                               'base64_encode'
          3        INIT_FCALL                                               'addslashes'
          4        INIT_FCALL                                               'gzcompress'
          5        INIT_FCALL                                               'serialize'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        SEND_VAL                                                 9
         10        DO_ICALL                                         $3      
         11        SEND_VAR                                                 $3
         12        DO_ICALL                                         $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                         $5      
         15        SEND_VAR                                                 $5
         16        SEND_VAL                                                 '%2B%2F%3D'
         17        SEND_VAL                                                 '-_%2C'
         18        DO_ICALL                                         $6      
         19        ASSIGN                                                   !1, $6
    4    20      > RETURN                                                   !1
    5    21*     > RETURN                                                   null

End of function encode_string_array

Function decode_string_array:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dP7in
function name:  decode_string_array
number of ops:  21
compiled vars:  !0 = $stringArray, !1 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'unserialize'
          2        INIT_FCALL                                               'gzuncompress'
          3        INIT_FCALL                                               'stripslashes'
          4        INIT_FCALL                                               'base64_decode'
          5        INIT_FCALL                                               'strtr'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 '-_%2C'
          8        SEND_VAL                                                 '%2B%2F%3D'
          9        DO_ICALL                                         $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                         $3      
         12        SEND_VAR                                                 $3
         13        DO_ICALL                                         $4      
         14        SEND_VAR                                                 $4
         15        DO_ICALL                                         $5      
         16        SEND_VAR                                                 $5
         17        DO_ICALL                                         $6      
         18        ASSIGN                                                   !1, $6
    9    19      > RETURN                                                   !1
   10    20*     > RETURN                                                   null

End of function decode_string_array

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.63 ms | 1400 KiB | 31 Q