$var1 = 'hello';
$var2 = $var1; // In C the variable var2 is created in memory right here
$var2 = 'bye'; // In PHP the variable var2 is created in memory here, up until now it still uses the same location of memory as var1
So in general, references should only be used if you want to work with the original variable, as it does not save memory or processing time.
Umm, read my answer again!
If you have something to add or contribute, feel free. Otherwise my point was that you apparently dont want faster updates... so you want slower updates by process of elimination.
If you have something to contribute, meaningful answers are better.
These features described above are good, but far from what developers will like the most.
The main feature that developers will care and love the most it's called "Bring Your Own Models". It gives us the ability to connect to LOCAL AI models running on Ollama.
The feature it's located on GitHub Copilot tab -> On the model picker where you can select "manage models" instead of paid models and then it will show you the "Bring your own models" window where you can now select Ollama and the endpoint of your local server.
So if you have a beefy spec machine you can now use your own model 100% local inside Visual Studio 2026 18.7.0
Microsoft Teams is getting a controversial location tracking feature that users may hate by Usama Jawad
Image generated with Microsoft Copilot
Earlier this year, Microsoft planned to roll out a controversial location tracking feature in Teams, but following customer feedback, it decided to delay its release. The bad news is that the company has decided to launch it later this year, but it's based on roughly the same design that was shared earlier, which means that many users still have good reason to worry.
Basically, Microsoft Places and Teams have received workplace check-ins via Wi-Fi. The idea is that if an employee arrives at the office and connects to their enterprise network, their profile status indicator will show them as being present in the office. For example, if you arrive at work, open Teams on your PC, and connect to the "Studio B" company Wi-Fi network, your Teams profile will indicate that you are present in "Studio B", as shown below:
Microsoft says that this feature is basically a replacement for physical workplace check-in peripherals, it reduces the need to manually update your status, and it also enables co-workers to know that you're at work so that they can coordinate in-person meetings with you. IT admins can enable this workplace check-in capability at a tenant level, and users have the ability to control whether they want to enable it or not.
Of course, all of that sounds great on paper, but naturally, many Teams customers may still have concerns, as they did before. This is because it enables your reporting manager and other members of the organization to track if you are at the office, when you arrive at the office, and where you are right now. This could be problematic for people who work in what they consider to be flexible work environments or hybrid setups, and this kind of location tracking could be considered an invasion of privacy.
Microsoft has tried to alleviate some of these concerns by letting users know that they can manually set their location easily, which essentially overrides workplace check-in if they feel uncomfortable with it. However, that doesn't really solve the problem because your organization could enforce a workplace policy that mandates that this feature remains enabled.
The Redmond tech giant has also assured users that this capability does not store historical data and is only a real-time indicator of location. Finally, it only generates a signal when you connect to a corporate network, which means that if you are working from home and connect your PC to your personal Wi-Fi, it won't broadcast your location to your employer; you will simply be shown as "Remote".
Microsoft has encouraged IT admins to prepare for this change and begin informing users so they know what to expect once it begins rolling out later this year.
Question
balupton
It seems that a lot or even most php programmers just jumped in and never read the manual or even know basic syntax...
The ones I see all the time are:
Not checking variable existence by just doing
instead of the correct
which will not return a notice exception
Reference: http://au3.php.net/manual/en/language.variables.php
Using short tags
instead of the proper
which will run on many more servers
Reference: http://php.net/manual/en/language.basic-syntax.php
Also the misuse of double quotes
should be
which saves processing time
Reference: http://php.net/manual/en/language.types.st...g.syntax.single
Those are just some of the most common ones.
So what i'm asking is:
Why didn't you know this stuff if you didn't before hand?
Or if you did know this, then why do you think things like this are so ignored?
Note:
The option "I thought I did until now." should read "No, I'm a professional developer."
The option "No." should read "No, I'm a unprofessional developer."
-------------------
This thread has kinda turned into a tips thread, so here are a collection of tips that have been collected so far.
Single quotes vs Double quotes
https://www.neowin.net/forum/index.php?show...amp;p=588249172
Switch statements VS if then else statements
switch ($var) { case $option1: break; case $option2: break; default: break; } // is faster than if ( $var == $option1 ) { } elseif ( $var == $option2 ) { } else { }Thanks to redFX for reminding us of that:
https://www.neowin.net/forum/index.php?show...amp;p=588271991
If then else statements VS ternary statements
if ( false ) { echo 'true'; } else { echo 'false'; } // if faster than echo (false ? 'true' : 'false'); // which is faster than echo false ? 'true' : 'false';Also applies for $var =, instead of echo. Thanks to redFX for that:
https://www.neowin.net/forum/index.php?show...amp;p=588271991
Pre-Increment VS Post-Increment
This applies everywhere, so in for loops etc. Thanks to phpmozzer for that:
https://www.neowin.net/forum/index.php?show...amp;p=588271806
Loops in order of speed
for, foreach, while, do-while. Thanks to redFX for that:
https://www.neowin.net/forum/index.php?show...amp;p=588271808
Strict (===) comparison is faster than loose (==) comparison.
https://www.neowin.net/forum/index.php?show...amp;p=588271983
Instantiating classes
Thanks to http://www.php.lt/benchmark/phpbench.php
For loops and size calculations
for ( $i = 0, $n = sizeof($array); $i < $n; $i++ ) {} // is faster than for ( $i = 0; $i < sizeof($array); $i++ ) {}https://www.neowin.net/forum/index.php?show...amp;p=588249623
Variable declarations and memory
So in general, references should only be used if you want to work with the original variable, as it does not save memory or processing time.
https://www.neowin.net/forum/index.php?show...amp;p=588249172
If you know any others, feel free to post them :)
Edited by baluptonLink to comment
https://www.neowin.net/forum/topic/531433-php-do-you-know-basic-syntax/Share on other sites
39 answers to this question
Recommended Posts