3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'hello i&#39;ve got a question'; echo json_encode( htmlspecialchars_decode($str, ENT_QUOTES), JSON_HEX_QUOT|JSON_HEX_AMP|JSON_HEX_APOS|JSON_HEX_TAG );

preferences:
52.96 ms | 402 KiB | 5 Q