I have written small js/html tools on my iPhone with help of a Bluetooth keyboard. No PHP though as iOS doesn't allow code execution environments except for the browser.
In my experience the biggest drawback on these kinds of setups is the small screensize (I strongly prefer coding with three giant displays), and this limitation cannot easily be overcome while keeping the device tiny. I'm looking forward to the Lenovo X1 Fold though to see if this reduces the pain a bit. And I love my Asus ZenScreen as a second-screen solution that easily fits in my backpack.