3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = 'a:4:{i:0;O:8:"stdClass":2:{s:3:"aaa";a:2:{i:0;s:5:"AAAAA";i:1;i:2;}s:3:"aaa";i:3;}i:2;i:4;i:3;i:5;s:3:"ccc";R:4;}'; $x = unserialize($data); //var_dump($x); var_dump(is_string($x['ccc'])); var_dump(in_array($x['ccc'], array('test'))); //var_dump(is_string($x['ccc'])); var_dump(is_string($x['ccc']) && in_array($x['ccc'], array('test'))); if(is_string($x['ccc']) && in_array($x['ccc'], array('test'))) { $a = 'aaaaa'; $b = 'bbbbb'; var_dump($x['ccc']); echo 'haha'; } else { echo 'fuck'; }
based on apRM0
Output for 5.4.36 - 7.2.0
bool(true) bool(false) bool(false) fuck
Output for 5.4.0 - 5.4.35
bool(true)
Process exited with code 139.
Output for 5.3.10 - 5.3.29
bool(true) NULL bool(true) string(5) "aaaaa" haha