3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $value = 'hrace009'; $secretKey = '1dc3d24bae14ada5dd85cda425cfdcee'; function encrypt($value, $secretKey) { $method = 'AES-128-CBC'; $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($method)); $encrypted = openssl_encrypt($value, $method, $secretKey, 0, $iv); $ecnrypted = base64_encode($encrypted); $encrypted = strtr($encrypted,'+/=', '-_,'); $encrypted = trim($encrypted); return $ecnrypted; } function decrypt($value, $secretKey) { $method = 'AAES-128-CBC'; $extracted = explode(':', $value); return openssl_decrypt($extracted[0], $method, $secretKey, 0, $extracted[1]); } $encrypted = encrypt($value, $secretKey); echo $encrypted;
based on PMisq
Output for 7.0.0 - 7.3.1
Fatal error: Uncaught Error: Call to undefined function openssl_random_pseudo_bytes() in /in/r77r6:9 Stack trace: #0 /in/r77r6(24): encrypt('hrace009', '1dc3d24bae14ada...') #1 {main} thrown in /in/r77r6 on line 9
Process exited with code 255.
Output for hhvm-3.17.3
S3NONHN1WExkMG1SVjl2VHRwdkh2UT09
Output for hhvm-3.15.4
VVFJbHBtaXVFajJCQXlhZ1pCNFBmdz09
Output for hhvm-3.12.14
QmNvaEJ2VWgzeS9yQVNHTVBZeG5Hdz09
Output for 5.6.38
Fatal error: Call to undefined function openssl_random_pseudo_bytes() in /in/r77r6 on line 9
Process exited with code 255.
Output for 5.6.30
Y0Jsa1ZzQ3dNeUdieDJsM2VyVXNCZz09
Output for 5.6.29
ZmozUHNneDBIOEpMTG4rOFBqSlVyUT09
Output for 5.6.28
ZGRaSE9YRnFQZVpicTZDWDhJZ3Jrdz09
Output for 5.6.27
ek5DdlVORVlQek0ybWwwRDY5MjlCdz09
Output for 5.6.26
THdsUU9vMVlucW1STmludmZGSHlVZz09
Output for 5.6.25
d1lEQmlKaWRZdGg0NWdTeEphMWF3Zz09
Output for 5.6.24
Q0ZrMDdyMG5tU1B1TGJaSVZmdEYrUT09
Output for 5.6.23
L0tSWjBHUml5NEFKUWd1WXovSk5aUT09
Output for 5.6.22
QUhUWUtITFBRdCtUeHhBOGM1TVBoZz09
Output for 5.6.21
a3U4NzJURUYxOUFKVllZaDdjenNEUT09
Output for 5.6.20
ckFIdWZJdGEvVmZqcDNDVnBvOGY2Zz09
Output for 5.6.19
Rjh3T2Z2M0drVnZOSnFVbDhIMEM3Zz09
Output for 5.6.18
MW9uNy9OOFB0K2xoQ0RLeFNtMDUxdz09
Output for 5.6.17
YXFUbFdNMVZHYlNJdWt2dUZ0aVQvQT09
Output for 5.6.16
KzNUZ2t4RDNMZ2wzTGw1R3E5dENJZz09
Output for 5.6.15
ay9JWnhadkkyUG5NL3lhc0VVTXJyQT09
Output for 5.6.14
SUIvU1F4Qy9mN2tCNnk2SDNINTBzUT09
Output for 5.6.13
T1JHSElWcHdUbEF5eTAvVkxmSm5hUT09
Output for 5.6.12
SkwyRG1nTG04ZjNKZ05oWmk2TjVYdz09
Output for 5.6.11
RDFLcEZlbU85ZEoreXZzUEd4Q2Nudz09
Output for 5.6.10
TTdvckwxS1NiNFh1WC9uQ0tPQ0FNQT09
Output for 5.6.9
TXNPMEZsRHpDQStUdGJYOU1iMTdpZz09
Output for 5.6.8
d054VnppUjR2TkhjVlRPbWZCOUdjUT09
Output for 5.6.7
dnBKK3drdGYzY1pzR0J3NmprazVCUT09
Output for 5.6.6
VzMxS0FPeTR1SWNuMlpwWUJNc0pDUT09
Output for 5.6.5
Q1lyK0REV0NtcHg1MXBYUDBoaVFaUT09
Output for 5.6.4
eGdYMHp6WEp4K2IzS2lNd3lteXNUZz09
Output for 5.6.3
SXFlRVR1Mk5kd2dUU3dvZlpjVHBpdz09
Output for 5.6.2
S0RDU2psRWlFTVQ0b3lscUJZRVpTQT09
Output for 5.6.1
ZVBQTldteHFjVjBvLzhWRkY0ZmExQT09
Output for 5.6.0
b09BdkE4YkFTRC9vUG04TDRGUjFtQT09