Hacker News new | past | comments | ask | show | jobs | submit login

Bourne shells as early as Version 7 Unix (1979, [1]) had rather elaborate interpolation of variables into strings (i.e., not just ${foo} but ${foo?bar}, etc.).

I'm reasonably sure that earlier versions of sh had some facility for this as well.

So, it's not really a PHP innovation, although some people might have seen it first there.

[1] https://www.in-ulm.de/~mascheck/bourne/v7/ -> "Parameter substitution"

Apparently Unix Version 6 (1975) used Thompson Shell which (provided the manuals are correct [1][2]) didn't support arbitrary variables (and even environment variables were not a thing back then). However for use in scripts $0, $1, etc were replaces with the script name and the arguments.

1: https://www.in-ulm.de/~mascheck/bourne/v6/

2: https://etsh.nl/man/_tsh.1.html

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact