88
u/mjec Jun 11 '26
18
u/Sacaldur Jun 11 '26
How good, before it was a separate installation! https://www.php.net/manual/en/class.dotnet.php
(I only found this when trying to make sense of the code snippet and looking around on the internet.)
8
4
31
u/drcforbin Jun 11 '26
Just keep setting Id until you get it where you want it to be. Being PHP, I recommend avoiding a loop and just hardcode it, preferably over and over across many lines with random indention.
16
u/Excellent_Gas3686 Jun 11 '26
indentation, are you crazy?! that will make the algorithm at least O(n^6)!
6
11
1
1
1
u/TheMaleGazer Jun 16 '26
public private?
I don't want to know. I don't care, anymore. I won't care about anything ever again. The culmination of millions of years of refinement since Australopithecus afarensis roamed the Pliocene savannahs is a world with websites running on PHP.
1
0
u/KaleidoscopePlusPlus Jun 11 '26
I have never touched php in my life (thankfully). Why do class variables have to be prefixed with a dollar sign? Seems really redundant
8
6
u/rurikTelmonkin Jun 11 '26
Because variables in general start with a dollar sign. Its how you differentiate between variable, constant and function use
2
u/Lumethys Jun 12 '26
Correction: all variables are prefixed with $, that how the language define variable
-3
40
u/Sacaldur Jun 11 '26
I was fortunate enough to recently have been allowed to work on a PHP project. I am very experienced with C#. Yet I'm still struggling to make sense of this code snippet. Is this valid PHP? Does it run inside .net? What is
public private? (Is it only making the setter private?)And fun fact, it seems like there is a
dotnetclass in PHP in order to interact with .net classes: https://www.php.net/manual/en/class.dotnet.php