Revision 7d56cba2-4df7-444f-ace9-ddf4e8c10b38 - Code Golf Stack Exchange
## [Perl 5], [Ruby], [JavaScript (Node.js)], [PHP], 609 bytes, score 4<sup>6</sup>/609 = 6.725779967159278
eval($_='$q=0?[34 .chr,113 .chr+40 .chr+41 .chr+96 .chr*2+39 .chr*2]:[]?[]+[]?eval(q(a.x)^q(!_E(chr(113).chr+40,chr(34).chr(34).chr(96).chr(96).chr(39).chr+39,chr+41))):[String.fromCharCode(96+!eval(String.fromCharCode(112,114,105,110,116,102,61,99,111,110,115,111,108,101,46,108,111,103))),String.fromCharCode(34,34,113,40,41,39,39)]:[chr(39),chr(34).chr(34).chr(113).chr(40).chr(41).chr(96).chr(96)];');printf($x='eval($_=%s%s%s);printf($x=%s%s%s,$q[0],$_,$q[2]?$q[2]:$q[0],$q[0],$x,$q[2]?$q[2]:$q[0],$q[1],$q[1]);//#%s%s',$q[0],$_,$q[2]?$q[2]:$q[0],$q[0],$x,$q[2]?$q[2]:$q[0],$q[1],$q[1]);//#""``q()""``q()
[Validate it online!](https://tio.run/##rVJNb5tAEL3zKzaEyrv1hrAGo@Kt60MUqeqhspojog7GJFARwJgkjpT/7s5@pIJAbpXNzuyb4b3Zt2zjQ3Y61WlTIDsv68fWbvMKfUN1VbzcF1Vr1wU3msftywflZsuNstqlH5T/HLhRZzW6aJBp4SRuO33E7OlkNTeM5wRdJJ0ebqRJBqvCe0O9g8Qg7yAQR@co3u1yYCrjApXpc5GX6YBNSishGZC5BkMWJjfExD1V1fWwm6Ov/YK0sIOgVyShVwTNvM/@C/wcsIsDjLKLgryBDgK0Ehpj/xE/xTdJk9ctwj/hasAHMlATFzOqJgryQjsIyEhoTG39fT00Shg67pSo9D@Ibg0@CbANylrpdEqf4gJbm@XE2i@dVeh6yE6yhjLmymTqOToyFQNfxs@zqRvoLFqE0SqMprBKtj2O7SP5vcdnm2sMHRjIiCajYu96cvsvBn4/uoFqdwOqpAkhi/CmbfLy3r5rqoerLG6uwDB4Y3omNceKjM3gHB5lzhyiA48P@Yz6jAYB7JhG5yp3vsDDqOerVEIuKNMxbtej8IeDUTiTxyiMClODE3r@0XO@@YA9R0c2MCDiE8JrEGzvsHVcTt7u59NB/LolhVBrHzoRtTYimUUruS40qNbjeInplfDLy3NBNflPXKZ5e7vHRIe/ "Bash – Try It Online")
### Explanation
This turned out a lot longer than I'd hoped and I made my life a little harder too, so I'm likely to keep tinkering with it. I'd like to add in more languages too, but I need to find something that doesn't mind a `$` sigil...
This is pretty much a standard quine format where the calculation of the quote to use is a little different for each language: in Ruby `"` is used, PHP uses `'`, JavaScript (Node.js) makes use of `` ` `` and Perl 5 utilises `q(`...`)`. Because only the quotes change, the rest of the program is still executable and valid syntax in each language.
The results are:
* Perl 5:
```eval($_=q(```...```));printf($x=q(```...```),```...```);//#""``''""``''```
* Ruby:
```eval($_="```...```");printf($x="```...```",```...```);//#q()``''q()``''```
* JavaScript (Node.js):
```eval($_=` ```...``` `);printf($x=` ```...``` `,```...```);//#""q()''""q()''```
* PHP:
```eval($_='```...```');printf($x='```...```',```...```);//#""q()``""q()`` ```
__Note__: JavaScript (Node.js) outputs a trailing newline, if that invalidates this, I'll add in some additional code to cater for that.
[Perl 5]: https://www.perl.org/
[PHP]: https://php.net/
[Ruby]: https://www.ruby-lang.org/
[JavaScript (Node.js)]: https://nodejs.org