The weather was warm, but in the evening everything froze
During the day, the weather was warm, around +1 degree. Outside, everything started to melt, and small puddles appeared. Because of that, I decided to go outside and clean my car, as it was covered with wet snow. I didn’t want all that snow to freeze on it later. If it froze, it would cause more inconvenience, and I would have to spend extra time removing it. So I decided to be on the safe side and cleaned the car. And I was right — in the evening, everything started to freeze.
Now it is −7 degrees outside, and at night the forecast predicts up to −10 degrees. As a result, all the roads and pedestrian areas look like mirrors because everything is frozen. I felt it myself when I went for a walk after 10 PM. Still, it wasn’t too bad for me. I could walk along the embankment without serious problems and just had to be careful. I didn’t want to slip, hurt myself, or end up lying there.
This workday started with reviewing my mistakes in work tasks, which I mentioned in my previous post. I decided to figure everything out and dive deeper. The first task, where I passed the wrong parameter type, was clear and understandable. However, the second task had a controversial moment and didn’t give me any peace. When I started debugging the code, I couldn’t find the mistake that my team lead had pointed out. He said that
$arResult["USER_PHONES"]would always be true. However, during debugging, I never saw it as true. Then I wrote a short report about my debugging process and attached it to my merge request. After that, he replied: “Oh, faq, I don’t know why I thought that, but the code is correct.” After that, he simply pushed the code to the production server. Still, in that place I could use
!empty($arResult["USER_PHONES"])because it is more readable and works for all cases. But even without it, the code will work correctly, so I think using empty() there is a bit unreasonable. However, I decided to follow my team lead’s advice and use empty() to check that array.