Skip to content

Latest commit

 

History

History
298 lines (296 loc) · 9.02 KB

File metadata and controls

298 lines (296 loc) · 9.02 KB

PHP tips and tricks

.. toctree::
   :maxdepth: 1
   :caption: Contents:

   tips/not_set_but_exists.rst
   tips/sorting_enum.rst
   tips/hypot.rst
   tips/spaceship_always_false.rst
   tips/inverted-spaceship.rst
   tips/isset-empty-valued.rst
   tips/comparing-arrays.rst
   tips/mixed_compatibility.rst
   tips/comma_in_number.rst
   tips/arg_renaming.rst
   tips/htmlemtities_failing.rst
   tips/static_arrow_function.rst
   tips/defined.rst
   tips/expm1.rst
   tips/isset_class_constant.rst
   tips/preg_split.rst
   tips/compare_nan.rst
   tips/array_unique_and_enum.rst
   tips/tree-iterator.rst
   tips/speed_up_write_to_disk.rst
   tips/maxmemory.rst
   tips/parent_operator.rst
   tips/stuttering.rst
   tips/make_it_work.rst
   tips/crazy_const_type.rst
   tips/http_wrapper.rst
   tips/cast_but_not_cast.rst
   tips/hexadecimal_separator.rst
   tips/echo-comma.rst
   tips/errorNumber.rst
   tips/put_the_cast_where.rst
   tips/unpacking_single_array.rst
   tips/abstract_or_not.rst
   tips/int_and_ant.rst
   tips/cast_in_const.rst
   tips/global_overwrite.rst
   tips/property_hook_default_values.rst
   tips/static_and_not_static.rst
   tips/intval.rst
   tips/easy_map.rst
   tips/returningVoid.rst
   tips/casting_enum.rst
   tips/dynamic_class_constant_edges.rst
   tips/dynamic_enum_cases.rst
   tips/yield_and_keys.rst
   tips/array-callaback-index.rst
   tips/closureCreation.rst
   tips/fatal_error_on_coalesce.rst
   tips/weakmap.rst
   tips/parent_in_function.rst
   tips/isset_and_the_fatal_error.rst
   tips/allDereferencements.rst
   tips/noPropertyBelowMininum.rst
   tips/cantBeBackCompatible.rst
   tips/arrowFunctionsImportVariables.rst
   tips/neverIsAlwaysCovariant.rst
   tips/neverFunctionArrow.rst
   tips/noExitRewrite.rst
   tips/aliasConflicts.rst
   tips/notAllIncrementStrings.rst
   tips/get_class_or_class.rst
   tips/noBindingButOriginal.rst
   tips/infinite_foreach.rst
   tips/who_modifies_this.rst
   tips/mixed_is_not_no_type.rst
   tips/array_merge_recursive.rst
   tips/GLOBALS_is_not_defined.rst
   tips/cast_private_to_array.rst
   tips/property_in_interface.rst
   tips/bit_operation_on_string.rst
   tips/typed_variables.rst
   tips/type_and_reference.rst
   tips/chaining_spaceship.rst
   tips/parse_str_edge_cases.rst
   tips/closure_to_array.rst
   tips/list_does_not_type.rst
   tips/triple_plus_operator.rst
   tips/FunctionNameInAMethod.rst
   tips/quine.rst
   tips/named_parameter_in_an_array.rst
   tips/selfOnAClosure.rst
   tips/compatible_new_argument.rst
   tips/no_const_A.rst
   tips/http_build_query_enum.rst
   tips/cannot-initialy-modify-readonly.rst
   tips/ellipsisAndCoalesce.rst
   tips/namespace_namespace.rst
   tips/namespace_but_far.rst
   tips/no-hidden-nullable.rst
   tips/remove_last_item.rst
   tips/cancelling_native_function.rst
   tips/class_const_confusion.rst
   tips/compact_is_recursive.rst
   tips/no-final-parameter.rst
   tips/is_not_a_nan.rst
   tips/impossible_named_arguments.rst
   tips/func_get_args.rst
   tips/ellipsis_array_parameters.rst
   tips/named_parameter_inheritance.rst
   tips/invoke_on_new.rst
   tips/method_or_property.rst
   tips/no_more_class__.rst
   tips/method_not_property_name_must_be_string.rst
   tips/static_properties.rst
   tips/new_and_parenthesis.rst
   tips/fluent_function.rst
   tips/isset_on_expression.rst
   tips/constant_redefinition.rst
   tips/no-constant-in-string.rst
   tips/return_int_not_bool.rst
   tips/by_reference_errors.rst
   tips/call_function_with_strings.rst
   tips/non-empty-match.rst
   tips/named_sqlite3_in_memory.rst
   tips/variable_creation.rst
   tips/all_cases.rst
   tips/unicode_comments.rst
   tips/datetime_and_year.rst
   tips/escaped_regex.rst
   tips/every_anonymous_class.rst
   tips/instanceof_with_variable.rst
   tips/undefined_variable.rst
   tips/compatible-signature.rst
   tips/private_is_relaxed.rst
   tips/class_implements_no_more.rst
   tips/variadic_are_typed_and_defaulted.rst
   tips/array_column_to_hash.rst
   tips/array_is_custom.rst
   tips/array_is_not_an_array.rst
   tips/array_map_assoc.rst
   tips/array_map_to_the_max.rst
   tips/typed_array.rst
   tips/initialize_readonly_on_child.rst
   tips/silent_optimisation.rst
   tips/array_syntax_on_string.rst
   tips/no_force_object_to_string.rst
   tips/invoke_and_properties.rst
   tips/constructor_needed.rst
   tips/self-referencing-constants.rst
   tips/deanonymize-class.rst
   tips/noscream-on-ellipsis.rst
   tips/incompatible-promoted-readonlies.rst
   tips/where-is-the-semicolon.rst
   tips/self-as-attribute.rst
   tips/microtimes.rst
   tips/promoted_compatibility.rst
   tips/enum_are_not_linted.rst
   tips/sorting_with_minus.rst
   tips/override_with_interface.rst
   tips/send_to_generator.rst
   tips/php_integer_format.rst
   tips/compatible_interface.rst
   tips/no_cast_in_constant_expression.rst
   tips/self_invoking.rst
   tips/no_child_with_attribute.rst
   tips/dynamic_class_constant.rst
   tips/function_function.rst
   tips/match_multiple_values.rst
   tips/interface_constant_conflict.rst
   tips/foreach_skips_uninitialized.rst
   tips/cast_and_power.rst
   tips/attribute_without_class.rst
   tips/class_is_valid_class.rst
   tips/precision.rst
   tips/store_float_as_index.rst
   tips/case_insensitive_cast.rst
   tips/this_this.rst
   tips/no-type-but-string.rst
   tips/no_unknown_for_array_merge.rst
   tips/no-returntype-enforced.rst
   tips/as-as-as.rst
   tips/no_dnf_for_catch.rst
   tips/new_on_object.rst
   tips/unfinished_class.rst
   tips/yield_not_return_by_reference.rst
   tips/enum_exists.rst
   tips/no_semi_colon_in_sight.rst
   tips/glob_with_hidden_files.rst
   tips/file_append_contents.rst
   tips/array_reduce.rst
   tips/this_is_not_the_current_class.rst
   tips/class_constant_different_types.rst
   tips/no_change_to_this.rst
   tips/file_put_array.rst
   tips/get_the_generator.rst
   tips/redefine_native_functions.rst
   tips/static_cannot_call_non_static.rst
   tips/before_after.rst
   tips/cast_is_strong.rst
   tips/roman_loops.rst
   tips/finally_catches_exception.rst
   tips/abstract_again.rst
   tips/always_compatible_variadic.rst
   tips/yield_not_return.rst
   tips/try-catch-finally.rst
   tips/nullAsArray.rst
   tips/sensitiveParameter.rst
   tips/no_property_in_interface.rst
   tips/uncallable_function.rst
   tips/easy_wither.rst
   tips/array_is_full.rst
   tips/const_without_parenthesis.rst
   tips/cast_are_case_insensitive.rst
   tips/not_same_error.rst
   tips/when_space_matters.rst
   tips/array_array_array.rst
   tips/yield_cannot_never.rst
   tips/class_invasion_reciproque.rst
   tips/typed_by_enum.rst
   tips/reference_on_static.rst
   tips/scalar_types_are_unqualified.rst
   tips/array_append.rst
   tips/coalesce_is_null.rst
   tips/class_alias_alias.rst
   tips/mixed_and_no_type.rst
   tips/abstract_constant.rst
   tips/static_static_property.rst
   tips/attributes_for_all.rst
   tips/run_any_phar_file.rst
   tips/static_outside_method.rst
   tips/enum_case_comparisons.rst
   tips/all_static_curly_syntaxes.rst
   tips/no_empty_function.rst
   tips/while_i_--.rst
   tips/unexpected_keys.rst
   tips/recursive_yield.rst
   tips/documenting_parameter.rst
   tips/catch_is_optional.rst
   tips/void_parameter.rst
   tips/unset_properties.rst
   tips/multipleAliases.rst
   tips/plus_plus_minus_minus.rst
   tips/when_a_constant_is_impossible.rst
   tips/constant_are_mutable.rst
   tips/quick-dto.rst
   tips/stealth-generator.rst
   tips/quick_serialize.rst
   tips/clone_clone_clone.rst
   tips/readonly_and_private.rst
   tips/interface_exceptions.rst
   tips/exp_minus_one.rst
   tips/infinite_is_reachable.rst
   tips/squared_negative.rst
   tips/negating_a_variable.rst
   tips/numeric_separator_string.rst
   tips/confusing_identifier.rst
   tips/relaxed_syntax_with_const.rst
   tips/closure_to_call.rst
   tips/static_get_this.rst
   tips/array_intersect_uassoc_insensitive.rst
   tips/class_and_constants.rst
   tips/dont_forget_yield.rst
   tips/phptip-1.rst
   tips/foreach_same_keys.rst
   tips/battle_of_definitions.rst
   tips/variadic_all_yield.rst
   tips/refactor_str_pos.rst
   tips/is_a_and_instanceof.rst
   tips/export_properties.rst
   tips/cast_to_int.rst
   tips/returntypewillchange_for_all.rst
   tips/URL_as_comments.rst
   tips/coalesce_and_assignation.rst
   tips/missing_methods_are_fatal.rst
   tips/initialize_with_coalesce.rst
   tips/keys_are_integers.rst
   tips/fastest_stdclass_creation.rst
   tips/elephpant.rst
   tips/internal_static_call.rst
   tips/strict_types_exceptions.rst
   tips/playing_with_the_limit.rst
   tips/constructor_consistency.rst
   tips/object_is_not_a_type.rst
   tips/forgotten_throw.rst
   tips/keywords_in_namespaces.rst
   tips/variable_optimisation.rst
   tips/self_in_interface.rst
   tips/instanceof_class.rst
   tips/stdclass_tracking.rst
   tips/misplaced_parenthesis.rst
   tips/check_for_names.rst
   tips/int_back_to_negative.rst
   tips/not_all_strings.rst
   tips/recursive_arrow_function.rst
   tips/null_equal_false.rst
   tips/recursive_closure.rst
   tips/cast_precedence.rst
   tips/enum_as_name.rst
   tips/type_is_not_available.rst
   tips/namespace_stack.rst
   tips/catch_interfaces.rst